Using gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", True) = GdPictureStatus.OK Then
Dim keywords As String = gdpicturePDF.GetKeywords()
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The original keywords of this PDF are: " + keywords, "Example: SetKeywords")
'These keywords are stored in the document information dictionary.
gdpicturePDF.SetKeywords("For Whom the Bell Tolls,Indian Camp,The Sun Also Rises,A Farewell to Arms,The Old Man and the Sea")
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If gdpicturePDF.SaveToFile("test.pdf") = GdPictureStatus.OK Then
keywords = gdpicturePDF.GetKeywords()
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
MessageBox.Show("The new keywords of this PDF are: " + keywords, "Example: SetKeywords")
End If
Else
MessageBox.Show("The file can't be saved.", "Example: SetKeywords")
End If
Else
MessageBox.Show("The SetKeywords() method has failed with the status: " + status.ToString(), "Example: SetKeywords")
End If
Else
MessageBox.Show("The GetKeywords() method has failed with the status: " + status.ToString(), "Example: SetKeywords")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: SetKeywords")
End If
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
if (gdpicturePDF.LoadFromFile("test.pdf", true) == GdPictureStatus.OK)
{
string keywords = gdpicturePDF.GetKeywords();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The original keywords of this PDF are: " + keywords, "Example: SetKeywords");
//These keywords are stored in the document information dictionary.
gdpicturePDF.SetKeywords("For Whom the Bell Tolls,Indian Camp,The Sun Also Rises,A Farewell to Arms,The Old Man and the Sea");
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if (gdpicturePDF.SaveToFile("test.pdf") == GdPictureStatus.OK)
{
keywords = gdpicturePDF.GetKeywords();
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
MessageBox.Show("The new keywords of this PDF are: " + keywords, "Example: SetKeywords");
}
}
else
{
MessageBox.Show("The file can't be saved.", "Example: SetKeywords");
}
}
else
{
MessageBox.Show("The SetKeywords() method has failed with the status: " + status.ToString(), "Example: SetKeywords");
}
}
else
{
MessageBox.Show("The GetKeywords() method has failed with the status: " + status.ToString(), "Example: SetKeywords");
}
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: SetKeywords");
}
}