'We assume that the GdViewer1 control has been integrated into your application.
Dim gdpicturePDF As GdPicturePDF = New GdPicturePDF()
If (gdpicturePDF.LoadFromFile("test.pdf", False) = GdPictureStatus.OK) AndAlso
(GdViewer1.DisplayFromGdPicturePDF(gdpicturePDF) = GdPictureStatus.OK) Then
Dim annotationManager As AnnotationManager = New AnnotationManager()
If (annotationManager.InitFromGdViewer(GdViewer1) = GdPictureStatus.OK) AndAlso
(annotationManager.PageCount > 0) AndAlso (annotationManager.SelectPage(1) = GdPictureStatus.OK) Then
Dim stamp As GdPicture14.Annotations.AnnotationRubberStamp = annotationManager.AddRubberStampAnnot(Color.Red, 0.5F, 0.5F, 2, 1, "APPROVED")
If stamp IsNot Nothing Then
stamp.Rotation = 20
annotationManager.SaveAnnotationsToPage()
stamp.Dispose()
Else
MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.InitFromGdViewer")
End If
End If
annotationManager.Close()
GdViewer1.Redraw()
End If
//We assume that the GdViewer1 control has been integrated into your application.
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if ((gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK) &&
(GdViewer1.DisplayFromGdPicturePDF(gdpicturePDF) == GdPictureStatus.OK))
{
AnnotationManager annotationManager = new AnnotationManager();
if ((annotationManager.InitFromGdViewer(GdViewer1) == GdPictureStatus.OK) &&
(annotationManager.PageCount > 0) && (annotationManager.SelectPage(1) == GdPictureStatus.OK))
{
GdPicture14.Annotations.AnnotationRubberStamp stamp = annotationManager.AddRubberStampAnnot(Color.Red, 0.5f, 0.5f, 2, 1, "APPROVED");
if (stamp != null)
{
stamp.Rotation = 20;
annotationManager.SaveAnnotationsToPage();
stamp.Dispose();
}
else
MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.InitFromGdViewer");
}
annotationManager.Close();
GdViewer1.Redraw();
}