Using gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", True) = GdPictureStatus.OK Then
Dim title As String = gdpicturePDF.GetTitle()
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The original title of this PDF is: " + title, "Example: SetTitle")
gdpicturePDF.SetTitle("This is a new title.")
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If gdpicturePDF.SaveToFile("test.pdf") = GdPictureStatus.OK Then
title = gdpicturePDF.GetTitle()
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
MessageBox.Show("The new title of this PDF is: " + title, "Example: SetTitle")
End If
Else
MessageBox.Show("The file can't be saved.", "Example: SetTitle")
End If
Else
MessageBox.Show("The SetTitle() method has failed with the status: " + status.ToString(), "Example: SetTitle")
End If
Else
MessageBox.Show("The GetTitle() method has failed with the status: " + status.ToString(), "Example: SetTitle")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: SetTitle")
End If
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
if (gdpicturePDF.LoadFromFile("test.pdf", true) == GdPictureStatus.OK)
{
string title = gdpicturePDF.GetTitle();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The original title of this PDF is: " + title, "Example: SetTitle");
gdpicturePDF.SetTitle("This is a new title.");
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if (gdpicturePDF.SaveToFile("test.pdf") == GdPictureStatus.OK)
{
title = gdpicturePDF.GetTitle();
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
MessageBox.Show("The new title of this PDF is: " + title, "Example: SetTitle");
}
}
else
{
MessageBox.Show("The file can't be saved.", "Example: SetTitle");
}
}
else
{
MessageBox.Show("The SetTitle() method has failed with the status: " + status.ToString(), "Example: SetTitle");
}
}
else
{
MessageBox.Show("The GetTitle() method has failed with the status: " + status.ToString(), "Example: SetTitle");
}
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: SetTitle");
}
}