The index of the required labeling range. It must be a value from 0 to GdPicturePDF.GetPageLabelsRangeCount-1.
Output parameter. The page number of the starting page of the specified labeling range.
Output parameter. The page labeling style of the specified labeling range. A member of the PdfPageLabelStyle enumeration.
Output parameter. The label prefix, if any is defined, for page labels of the specified labeling range.
Output parameter. The value of the numeric portion for the first page label of the specified labeling range.
Example





In This Topic
GdPicture14 Namespace / GdPicturePDF Class / GetPageLabelsRange Method

GetPageLabelsRange Method (GdPicturePDF)

In This Topic
Returns the properties of a specific page labeling range of the currently loaded PDF document.
Syntax
'Declaration
 
Public Function GetPageLabelsRange( _
   ByVal LabelingRangeIdx As Integer, _
   ByRef StartPage As Integer, _
   ByRef Style As PdfPageLabelStyle, _
   ByRef Prefix As String, _
   ByRef NumPortion As Integer _
) As GdPictureStatus
public GdPictureStatus GetPageLabelsRange( 
   int LabelingRangeIdx,
   ref int StartPage,
   ref PdfPageLabelStyle Style,
   ref string Prefix,
   ref int NumPortion
)
public function GetPageLabelsRange( 
    LabelingRangeIdx: Integer;
   var  StartPage: Integer;
   var  Style: PdfPageLabelStyle;
   var  Prefix: String;
   var  NumPortion: Integer
): GdPictureStatus; 
public function GetPageLabelsRange( 
   LabelingRangeIdx : int,
   StartPage : int,
   Style : PdfPageLabelStyle,
   Prefix : String,
   NumPortion : int
) : GdPictureStatus;
public: GdPictureStatus GetPageLabelsRange( 
   int LabelingRangeIdx,
   ref int StartPage,
   ref PdfPageLabelStyle Style,
   ref string* Prefix,
   ref int NumPortion
) 
public:
GdPictureStatus GetPageLabelsRange( 
   int LabelingRangeIdx,
   int% StartPage,
   PdfPageLabelStyle% Style,
   String^% Prefix,
   int% NumPortion
) 

Parameters

LabelingRangeIdx
The index of the required labeling range. It must be a value from 0 to GdPicturePDF.GetPageLabelsRangeCount-1.
StartPage
Output parameter. The page number of the starting page of the specified labeling range.
Style
Output parameter. The page labeling style of the specified labeling range. A member of the PdfPageLabelStyle enumeration.
Prefix
Output parameter. The label prefix, if any is defined, for page labels of the specified labeling range.
NumPortion
Output parameter. The value of the numeric portion for the first page label of the specified labeling range.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.

We strongly recommend always checking this status first.

Remarks
This method is only allowed for use with non-encrypted documents.
Example
How to retrieve properties of all defined page labeling ranges in the PDF document.
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();
See Also