GdPicture.NET.14.API
GdPicture14 Namespace / AnnotationManager Class / PageCount Property
Example





PageCount Property (AnnotationManager)
Gets the total number of pages in the document currently handled by this AnnotationManager object.
Syntax
'Declaration
 
Public ReadOnly Property PageCount As Integer
 
Remarks
Be aware that you have to select the required page before starting any page related action with the handled document.
Example
How to find out the number of pages in the currently handled document.
Using annotationManager As AnnotationManager = New AnnotationManager()
    If annotationManager.InitFromFile("test.pdf") = GdPictureStatus.OK Then
        Dim message As String = "The number of pages: " + annotationManager.PageCount
        For p As Integer = 1 To annotationManager.PageCount - 1
            If annotationManager.SelectPage(p) = GdPictureStatus.OK Then
                Dim annotCount As Integer = annotationManager.GetAnnotationCount()
                If annotationManager.GetStat() = GdPictureStatus.OK Then
                    message = message + vbCrLf + "The page nr." + p + " contains " + annotCount.ToString() + " annotations."
                Else
                    MessageBox.Show("The GetAnnotationCount() method has failed with the status: " + annotationManager.GetStat().ToString(), "AnnotationManager.PageCount")
                    Exit For
                End If
            Else
                MessageBox.Show("The SelectPage() method has failed with the status: " + annotationManager.GetStat().ToString(), "AnnotationManager.PageCount")
                Exit For
            End If
        Next
        If annotationManager.GetStat() = GdPictureStatus.OK Then MessageBox.Show(message, "AnnotationManager.PageCount")
        annotationManager.Close()
    Else
        MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.PageCount")
    End If
End Using
See Also