Dim caption As String = "Example: GetPageLabel"
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 = message + rangesCount.ToString() + " page labeling ranges are defined in this PDF document." + vbCrLf
Else
message = message + "The GetPageLabelsRangeCount() method has failed with the status: " + status.ToString() + vbCrLf
End If
Dim pageCount As Integer = gdpicturePDF.GetPageCount()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
Dim pageLabel As String = ""
For i As Integer = 1 To pageCount
pageLabel = gdpicturePDF.GetPageLabel(i)
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
message = message + "The page number " + i.ToString() + " contains this page label = """ + pageLabel + """." + vbCrLf
Else
message = message + "The GetPageLabel() method has failed for the " + i.ToString() + ". page with the status: " + status.ToString() + vbCrLf
End If
Next
MessageBox.Show(message, caption)
Else
MessageBox.Show("The GetPageCount() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: GetPageLabel";
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 = message + rangesCount.ToString() + " page labeling ranges are defined in this PDF document.\n";
else
message = message + "The GetPageLabelsRangeCount() method has failed with the status: " + status.ToString() + "\n";
int pageCount = gdpicturePDF.GetPageCount();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
string pageLabel = "";
for (int i = 1; i <= pageCount; i++)
{
pageLabel = gdpicturePDF.GetPageLabel(i);
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
message = message + "The page number " + i.ToString() + " contains this page label = \"" + pageLabel + "\".\n";
}
else
message = message + "The GetPageLabel() method has failed for the " + i.ToString() + ". page with the status: " + status.ToString() + "\n";
}
MessageBox.Show(message, caption);
}
else
MessageBox.Show("The GetPageCount() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The file can't be loaded.", caption);
gdpicturePDF.Dispose();