Dim caption As String = "Example: IncreaseVersion"
Using gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", False) = GdPictureStatus.OK Then
Dim version As String = gdpicturePDF.GetVersion()
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The original version of this PDF is: " + version, caption)
If version.Equals("1.4", StringComparison.Ordinal) OrElse version.Equals("1.5", StringComparison.Ordinal) Then
status = gdpicturePDF.IncreaseVersion(1.6F)
If status = GdPictureStatus.OK Then
If gdpicturePDF.SaveToFile("test_IncreaseVersion.pdf") = GdPictureStatus.OK Then
MessageBox.Show("The version has been increased successfully.", caption)
Else
MessageBox.Show("The new file can't be saved.", caption)
End If
Else
MessageBox.Show("The IncreaseVersion() method has failed with the status: " + status.ToString(), caption)
End If
Else
If version.Equals("1.6", StringComparison.Ordinal) Then
MessageBox.Show("This PDF file already conforms to PDF version 1.6.", caption)
End If
End If
Else
MessageBox.Show("The GetVersion() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
End Using
string caption = "Example: IncreaseVersion";
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
if (gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK)
{
string version = gdpicturePDF.GetVersion();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The original version of this PDF is: " + version, caption);
if (version.Equals("1.4", StringComparison.Ordinal) || version.Equals("1.5", StringComparison.Ordinal))
{
status = gdpicturePDF.IncreaseVersion(1.6f);
if (status == GdPictureStatus.OK)
{
if (gdpicturePDF.SaveToFile("test_IncreaseVersion.pdf") == GdPictureStatus.OK)
{
MessageBox.Show("The version has been increased successfully.", caption);
}
else
{
MessageBox.Show("The new file can't be saved.", caption);
}
}
else
{
MessageBox.Show("The IncreaseVersion() method has failed with the status: " + status.ToString(), caption);
}
}
else
{
if (version.Equals("1.6", StringComparison.Ordinal))
{
MessageBox.Show("This PDF file already conforms to PDF version 1.6.", caption);
}
}
}
else
{
MessageBox.Show("The GetVersion() method has failed with the status: " + status.ToString(), caption);
}
}
else
{
MessageBox.Show("The file can't be loaded.", caption);
}
}