SetProducer Method (GdPicturePDF)
Sets up a new producer of the currently loaded PDF document into the document information dictionary and in the document catalog's metadata as well.
If the loaded PDF document contains metadata stored in the Metadata entry in the document catalog, the newly specified Producer property is synchronized with those metadata. That means, you will be able to see the changed value of this property using the Acrobat's Document Properties dialogue box.
public void SetProducer(
string
)
public procedure SetProducer(
: String
);
public function SetProducer(
: String
);
public: void SetProducer(
string*
)
public:
void SetProducer(
String^
)
'Declaration
Public Sub SetProducer( _
ByVal As String _
)
Parameters
- Producer
- A new value of the Producer property as a string.
How to set up a new producer of the PDF document.
Using gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", True) = GdPictureStatus.OK Then
Dim producer As String = gdpicturePDF.GetProducer()
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The original producer of this PDF is: " + producer, "Example: SetProducer")
gdpicturePDF.SetProducer("GdPicture.Net")
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If gdpicturePDF.SaveToFile("test.pdf") = GdPictureStatus.OK Then
producer = gdpicturePDF.GetProducer()
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
MessageBox.Show("The new producer of this PDF is: " + producer, "Example: SetProducer")
End If
Else
MessageBox.Show("The file can't be saved.", "Example: SetProducer")
End If
Else
MessageBox.Show("The SetProducer() method has failed with the status: " + status.ToString(), "Example: SetProducer")
End If
Else
MessageBox.Show("The GetProducer() method has failed with the status: " + status.ToString(), "Example: SetProducer")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: SetProducer")
End If
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
if (gdpicturePDF.LoadFromFile("test.pdf", true) == GdPictureStatus.OK)
{
string producer = gdpicturePDF.GetProducer();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The original producer of this PDF is: " + producer, "Example: SetProducer");
gdpicturePDF.SetProducer("GdPicture.Net");
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if (gdpicturePDF.SaveToFile("test.pdf") == GdPictureStatus.OK)
{
producer = gdpicturePDF.GetProducer();
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
MessageBox.Show("The new producer of this PDF is: " + producer, "Example: SetProducer");
}
}
else
{
MessageBox.Show("The file can't be saved.", "Example: SetProducer");
}
}
else
{
MessageBox.Show("The SetProducer() method has failed with the status: " + status.ToString(), "Example: SetProducer");
}
}
else
{
MessageBox.Show("The GetProducer() method has failed with the status: " + status.ToString(), "Example: SetProducer");
}
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: SetProducer");
}
}