Dim gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", False) = GdPictureStatus.OK Then
Dim message As String = ""
Dim rangesCount As Integer = gdpicturePDF.GetPageLabelsRangeCount()
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
message = rangesCount.ToString() + " page labeling ranges are defined in this PDF document." + vbCrLf
status = gdpicturePDF.DeletePageLabels()
If status = GdPictureStatus.OK Then
message = message + "The page labeling ranges has been successfully deleted." + vbCrLf
rangesCount = gdpicturePDF.GetPageLabelsRangeCount()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
message = rangesCount.ToString() + " page labeling ranges are defined in this PDF document." + vbCrLf
If gdpicturePDF.SaveToFile("test_DeletePageLabels.pdf") = GdPictureStatus.OK Then
message = message + "The file has been saved."
Else
message = message + "The file can't be saved."
End If
Else
message = message + "The GetPageLabelsRangeCount() method has failed with the status: " + status.ToString()
End If
Else
message = message + "The DeletePageLabels() method has failed with the status: " + status.ToString()
End If
Else
message = message + "The GetPageLabelsRangeCount() method has failed with the status: " + status.ToString()
End If
MessageBox.Show(message, "Example: DeletePageLabels")
Else
MessageBox.Show("The file can't be loaded.", "Example: DeletePageLabels")
End If
gdpicturePDF.Dispose()
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK)
{
string message = "";
int rangesCount = gdpicturePDF.GetPageLabelsRangeCount();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
message = rangesCount.ToString() + " page labeling ranges are defined in this PDF document.\n";
status = gdpicturePDF.DeletePageLabels();
if (status == GdPictureStatus.OK)
{
message = message + "The page labeling ranges has been successfully deleted.\n";
rangesCount = gdpicturePDF.GetPageLabelsRangeCount();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
message = rangesCount.ToString() + " page labeling ranges are defined in this PDF document.\n";
if (gdpicturePDF.SaveToFile("test_DeletePageLabels.pdf") == GdPictureStatus.OK)
message = message + "The file has been saved.";
else
message = message + "The file can't be saved.";
}
else
message = message + "The GetPageLabelsRangeCount() method has failed with the status: " + status.ToString();
}
else
message = message + "The DeletePageLabels() method has failed with the status: " + status.ToString();
}
else
message = message + "The GetPageLabelsRangeCount() method has failed with the status: " + status.ToString();
MessageBox.Show(message, "Example: DeletePageLabels");
}
else
MessageBox.Show("The file can't be loaded.", "Example: DeletePageLabels");
gdpicturePDF.Dispose();