Using annotationManager As AnnotationManager = New AnnotationManager()
If (annotationManager.InitFromFile("test.jpeg") = 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
For a As Integer = 0 To annotCount - 1
annot = annotationManager.GetAnnotationFromIdx(a)
If annot IsNot Nothing Then
Dim type As GdPicture14.Annotations.Annotation.GdPictureAnnotationType = annotationManager.GetAnnotationType(a)
If type = GdPicture14.Annotations.Annotation.GdPictureAnnotationType.AnnotationTypeRuler Then
Dim comment As GdPicture14.Annotations.AnnotationComment = annotationManager.AddCommentAnnot(annot.Guid, annot.Left, annot.Top, 1, 1)
If comment IsNot Nothing Then
comment.Text = "To be customized."
End If
End If
End If
Next
If (annotationManager.SaveAnnotationsToPage() = GdPictureStatus.OK) AndAlso
(annotationManager.SaveDocumentToJPEG("test_reviewed.jpeg", 75) = GdPictureStatus.OK) Then
MessageBox.Show("Done!", "AnnotationManager.AddCommentAnnot")
Else
MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.AddCommentAnnot")
End If
annotationManager.Close()
Else
MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.AddCommentAnnot")
End If
End Using
using (AnnotationManager annotationManager = new AnnotationManager())
{
if ((annotationManager.InitFromFile("test.jpeg") == GdPictureStatus.OK) &&
(annotationManager.PageCount > 0) && (annotationManager.SelectPage(1) == GdPictureStatus.OK))
{
int annotCount = annotationManager.GetAnnotationCount();
GdPicture14.Annotations.Annotation annot = null;
for (int a = 0; a < annotCount; a++)
{
annot = annotationManager.GetAnnotationFromIdx(a);
if (annot != null)
{
GdPicture14.Annotations.Annotation.GdPictureAnnotationType type = annotationManager.GetAnnotationType(a);
if (type == GdPicture14.Annotations.Annotation.GdPictureAnnotationType.AnnotationTypeRuler)
{
GdPicture14.Annotations.AnnotationComment comment = annotationManager.AddCommentAnnot(annot.Guid, annot.Left, annot.Top, 1, 1);
if (comment != null)
{
comment.Text = "To be customized.";
}
}
}
}
if ((annotationManager.SaveAnnotationsToPage() == GdPictureStatus.OK) &&
(annotationManager.SaveDocumentToJPEG("test_reviewed.jpeg", 75) == GdPictureStatus.OK))
MessageBox.Show("Done!", "AnnotationManager.AddCommentAnnot");
else
MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.AddCommentAnnot");
annotationManager.Close();
}
else
MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.AddCommentAnnot");
}