GdPicture.NET.14
GdPicture14.WPF Namespace / GdViewer Class / PageCount Property
Example





In This Topic
PageCount Property (GdViewer)
In This Topic
Gets the total number of pages in the document currently displayed in the GdViewer control.
Syntax
'Declaration
 
Public ReadOnly Property PageCount As Integer
public int PageCount {get;}
public read-only property PageCount: Integer; 
public function get PageCount : int
public: __property int get_PageCount();
public:
property int PageCount {
   int get();
}
Remarks
Please note that the pages are numbered starting from 1.
Example
How to determine the number of pages in the currently displayed document.
'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
    MessageBox.Show("PageCount = " + GdViewer1.PageCount.ToString() + vbCrLf +
                    "CurrentPage = " + GdViewer1.CurrentPage.ToString(), "GdViewer.PageCount")
Else
    MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.PageCount")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
    MessageBox.Show("PageCount = " + GdViewer1.PageCount.ToString() +
                    "\nCurrentPage = " + GdViewer1.CurrentPage.ToString(), "GdViewer.PageCount");
}
else
    MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.PageCount");
See Also