Using annotationManager As AnnotationManager = New AnnotationManager()
If (annotationManager.InitFromFile("source.pdf") = GdPictureStatus.OK) AndAlso
(annotationManager.PageCount > 0) AndAlso (annotationManager.SelectPage(1) = GdPictureStatus.OK) Then
Dim annotCount As Integer = annotationManager.GetAnnotationCount()
Dim annot As GdPicture14.Annotations.Annotation = Nothing
Dim comment As GdPicture14.Annotations.AnnotationComment = Nothing
For a As Integer = 0 To annotCount - 1
annot = annotationManager.GetAnnotationFromIdx(a)
If annot IsNot Nothing Then
Dim annotType As GdPicture14.Annotations.Annotation.GdPictureAnnotationType = annotationManager.GetAnnotationType(a)
Dim commentIdx As Integer = annotationManager.GetFirstAnnotationCommentIdx(a)
If (annotationManager.GetStat() = GdPictureStatus.OK) AndAlso (commentIdx > -1) Then
comment = CType(annotationManager.GetAnnotationFromIdx(commentIdx), GdPicture14.Annotations.AnnotationComment)
If comment IsNot Nothing Then
MessageBox.Show("The type of the annotation with comment: " + annotType + vbCrLf + "The first comment:" + vbCrLf + comment.Text, "AnnotationManager.GetFirstAnnotationCommentIdx")
Else
MessageBox.Show("Something goes wrong.", "AnnotationManager.GetFirstAnnotationCommentIdx")
End If
'Else This annotation does not include any comment.
End If
Else
MessageBox.Show("Something goes wrong.", "AnnotationManager.GetFirstAnnotationCommentIdx")
End If
Next
annotationManager.Close()
Else
MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.GetFirstAnnotationCommentIdx")
End If
End Using
using (AnnotationManager annotationManager = new AnnotationManager())
{
if ((annotationManager.InitFromFile("source.pdf") == GdPictureStatus.OK) &&
(annotationManager.PageCount > 0) && (annotationManager.SelectPage(1) == GdPictureStatus.OK))
{
int annotCount = annotationManager.GetAnnotationCount();
GdPicture14.Annotations.Annotation annot = null;
GdPicture14.Annotations.AnnotationComment comment = null;
for (int a = 0; a < annotCount; a++)
{
annot = annotationManager.GetAnnotationFromIdx(a);
if (annot != null)
{
GdPicture14.Annotations.Annotation.GdPictureAnnotationType annotType = annotationManager.GetAnnotationType(a);
int commentIdx = annotationManager.GetFirstAnnotationCommentIdx(a);
if ((annotationManager.GetStat()== GdPictureStatus.OK) && (commentIdx>-1))
{
comment = (GdPicture14.Annotations.AnnotationComment)annotationManager.GetAnnotationFromIdx(commentIdx);
if (comment != null)
MessageBox.Show("The type of the annotation with comment: " + annotType + "\nThe first comment:\n" + comment.Text, "AnnotationManager.GetFirstAnnotationCommentIdx");
else
MessageBox.Show("Something goes wrong.", "AnnotationManager.GetFirstAnnotationCommentIdx");
}
//else This annotation does not include any comment.
}
else
MessageBox.Show("Something goes wrong.", "AnnotationManager.GetFirstAnnotationCommentIdx");
}
annotationManager.Close();
}
else
MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.GetFirstAnnotationCommentIdx");
}