Dim caption As String = "Example: GetPageLabelsRangeCount"
Dim gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", False) = GdPictureStatus.OK Then
Dim rangesCount As Integer = gdpicturePDF.GetPageLabelsRangeCount()
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If rangesCount > 0 Then
Dim message As String = "This PDF document contains " + rangesCount.ToString() + " labeling ranges." + vbCrLf
For i As Integer = 0 To rangesCount - 1
Dim startPage As Integer = 0, num As Integer = 0
Dim style As PdfPageLabelStyle = PdfPageLabelStyle.PdfPageLabelStyleUndefined
Dim prefix As String = ""
status = gdpicturePDF.GetPageLabelsRange(i, startPage, style, prefix, num)
If status = GdPictureStatus.OK Then
message = message + "The labeling range with the index " + i.ToString() + " starts at the page number " + startPage.ToString() + " and has these attributes:" + vbCrLf + "style = " + style.ToString() + " prefix = """ + prefix.ToString() + """ num.portion = " + num.ToString() + vbCrLf
Else
message = message + "The GetPageLabelsRange() method has failed for the " + i.ToString() + ". labeling range with the status: " + status.ToString() + vbCrLf
End If
Next
MessageBox.Show(message, caption)
Else
MessageBox.Show("This PDF document doesn't contain any page labeling ranges.", caption)
End If
Else
MessageBox.Show("The GetPageLabelsRangeCount() 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: GetPageLabelsRangeCount";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK)
{
int rangesCount = gdpicturePDF.GetPageLabelsRangeCount();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if (rangesCount > 0)
{
string message = "This PDF document contains " + rangesCount.ToString() + " labeling ranges.\n";
for (int i = 0; i < rangesCount; i++)
{
int startPage = 0, num = 0;
PdfPageLabelStyle style = PdfPageLabelStyle.PdfPageLabelStyleUndefined;
string prefix = "";
status = gdpicturePDF.GetPageLabelsRange(i, ref startPage, ref style, ref prefix, ref num);
if (status == GdPictureStatus.OK)
{
message = message + "The labeling range with the index " + i.ToString() + " starts at the page number " + startPage.ToString() + " and has these attributes:\n" +
"style = " + style.ToString() + " prefix = \"" + prefix.ToString() + "\" num.portion = " + num.ToString() + "\n";
}
else
message = message + "The GetPageLabelsRange() method has failed for the " + i.ToString() + ". labeling range with the status: " + status.ToString() + "\n";
}
MessageBox.Show(message, caption);
}
else
MessageBox.Show("This PDF document doesn't contain any page labeling ranges.", caption);
}
else
MessageBox.Show("The GetPageLabelsRangeCount() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The file can't be loaded.", caption);
gdpicturePDF.Dispose();