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
using (AnnotationManager annotationManager = new AnnotationManager())
{
if (annotationManager.InitFromFile("test.pdf") == GdPictureStatus.OK)
{
string message = "The number of pages: " + annotationManager.PageCount;
for (int p = 1; p < annotationManager.PageCount; p++)
{
if (annotationManager.SelectPage(p) == GdPictureStatus.OK)
{
int annotCount = annotationManager.GetAnnotationCount();
if (annotationManager.GetStat() == GdPictureStatus.OK)
{
message = message + "\nThe page nr." + p + " contains " + annotCount.ToString() + " annotations.";
}
else
{
MessageBox.Show("The GetAnnotationCount() method has failed with the status: " + annotationManager.GetStat().ToString(), "AnnotationManager.PageCount");
break;
}
}
else
{
MessageBox.Show("The SelectPage() method has failed with the status: " + annotationManager.GetStat().ToString(), "AnnotationManager.PageCount");
break;
}
}
if (annotationManager.GetStat() == GdPictureStatus.OK)
MessageBox.Show(message, "AnnotationManager.PageCount");
annotationManager.Close();
}
else
MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.PageCount");
}