SetCreator Method (GdPicturePDF)
In This Topic
Sets up a new creator 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 Creator 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.
Syntax
'Declaration
Public Sub SetCreator( _
ByVal As String _
)
public void SetCreator(
string
)
public procedure SetCreator(
: String
);
public function SetCreator(
: String
);
public: void SetCreator(
string*
)
public:
void SetCreator(
String^
)
Parameters
- Creator
- A new value of the Creator property as a string.
Example
How to set up a new creator of the PDF document.
Using gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", True) = GdPictureStatus.OK Then
Dim creator As String = gdpicturePDF.GetCreator()
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The original creator of this PDF is: " + creator, "Example: SetCreator")
gdpicturePDF.SetCreator("GdPicture")
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If gdpicturePDF.SaveToFile("test.pdf") = GdPictureStatus.OK Then
creator = gdpicturePDF.GetCreator()
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
MessageBox.Show("The new creator of this PDF is: " + creator, "Example: SetCreator")
End If
Else
MessageBox.Show("The file can't be saved.", "Example: SetCreator")
End If
Else
MessageBox.Show("The SetCreator() method has failed with the status: " + status.ToString(), "Example: SetCreator")
End If
Else
MessageBox.Show("The GetCreator() method has failed with the status: " + status.ToString(), "Example: SetCreator")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: SetCreator")
End If
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
if (gdpicturePDF.LoadFromFile("test.pdf", true) == GdPictureStatus.OK)
{
string creator = gdpicturePDF.GetCreator();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The original creator of this PDF is: " + creator, "Example: SetCreator");
gdpicturePDF.SetCreator("GdPicture");
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if (gdpicturePDF.SaveToFile("test.pdf") == GdPictureStatus.OK)
{
creator = gdpicturePDF.GetCreator();
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
MessageBox.Show("The new creator of this PDF is: " + creator, "Example: SetCreator");
}
}
else
{
MessageBox.Show("The file can't be saved.", "Example: SetCreator");
}
}
else
{
MessageBox.Show("The SetCreator() method has failed with the status: " + status.ToString(), "Example: SetCreator");
}
}
else
{
MessageBox.Show("The GetCreator() method has failed with the status: " + status.ToString(), "Example: SetCreator");
}
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: SetCreator");
}
}
Example
How to set up a new creator of the PDF document.
Using gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", True) = GdPictureStatus.OK Then
Dim creator As String = gdpicturePDF.GetCreator()
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The original creator of this PDF is: " + creator, "Example: SetCreator")
gdpicturePDF.SetCreator("GdPicture")
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If gdpicturePDF.SaveToFile("test.pdf") = GdPictureStatus.OK Then
creator = gdpicturePDF.GetCreator()
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
MessageBox.Show("The new creator of this PDF is: " + creator, "Example: SetCreator")
End If
Else
MessageBox.Show("The file can't be saved.", "Example: SetCreator")
End If
Else
MessageBox.Show("The SetCreator() method has failed with the status: " + status.ToString(), "Example: SetCreator")
End If
Else
MessageBox.Show("The GetCreator() method has failed with the status: " + status.ToString(), "Example: SetCreator")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: SetCreator")
End If
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
if (gdpicturePDF.LoadFromFile("test.pdf", true) == GdPictureStatus.OK)
{
string creator = gdpicturePDF.GetCreator();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The original creator of this PDF is: " + creator, "Example: SetCreator");
gdpicturePDF.SetCreator("GdPicture");
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if (gdpicturePDF.SaveToFile("test.pdf") == GdPictureStatus.OK)
{
creator = gdpicturePDF.GetCreator();
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
MessageBox.Show("The new creator of this PDF is: " + creator, "Example: SetCreator");
}
}
else
{
MessageBox.Show("The file can't be saved.", "Example: SetCreator");
}
}
else
{
MessageBox.Show("The SetCreator() method has failed with the status: " + status.ToString(), "Example: SetCreator");
}
}
else
{
MessageBox.Show("The GetCreator() method has failed with the status: " + status.ToString(), "Example: SetCreator");
}
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: SetCreator");
}
}
See Also