'We assume that the GdViewer control has been integrated into your application.
If GdViewer1.DisplayFromFile("custom.pdf") = GdPictureStatus.OK Then
'We assume that the annotationManager object has been integrated into your application as well,
'together with the proper definition of annotationManager_OnCustomAnnotationPaint() event.
annotationManager = GdViewer1.GetAnnotationManager();
If (annotationManager.PageCount > 0) AndAlso (annotationManager.SelectPage(1) = GdPictureStatus.OK) Then
Dim modelsCount As Integer = 2
Dim x As Single = 1, y As Single = 1, w As Single = 1, h As Single = 1, dist As Single = 2
For modelID As Integer = 1 To modelsCount
Dim annot As GdPicture14.Annotations.AnnotationCustom = annotationManager.AddCustomAnnot(modelID, x, y + (modelID - 1) * dist, w, h)
If annot IsNot Nothing Then
annot.Tag = "GdPicture custom annotation"
End If
Next
'The BurnAnnotationsToPage() method renders your custom anotations on the page using the annotationManager_OnCustomAnnotationPaint() event.
If (annotationManager.SaveAnnotationsToPage() = GdPictureStatus.OK) AndAlso
(annotationManager.BurnAnnotationsToPage(True, False) = GdPictureStatus.OK) AndAlso
(annotationManager.SaveDocumentToPDF("custom.pdf") = GdPictureStatus.OK) Then
'You also need to implement the GdViewer1_OnCustomAnnotationPaint() event, in the same way,
'to be able to see the added custom annotations in the viewer.
GdViewer1.Refresh()
End If
End If
If annotationManager.GetStat() <> GdPictureStatus.OK Then
MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.AddCustomAnnot")
End If
Else
MessageBox.Show("Error! Status: " + GdViewer1.GetStat().ToString(), "AnnotationManager.AddCustomAnnot")
End If
//We assume that the GdViewer control has been integrated into your application.
if (GdViewer1.DisplayFromFile("custom.pdf") == GdPictureStatus.OK)
{
//We assume that the annotationManager object has been integrated into your application as well,
//together with the proper definition of annotationManager_OnCustomAnnotationPaint() event.
annotationManager = GdViewer1.GetAnnotationManager();
if ((annotationManager.PageCount > 0) && (annotationManager.SelectPage(1) == GdPictureStatus.OK))
{
int modelsCount = 2;
float x = 1, y = 1, w = 1, h = 1, dist = 2;
for (int modelID = 1; modelID <= modelsCount; modelID++)
{
GdPicture14.Annotations.AnnotationCustom annot = annotationManager.AddCustomAnnot(modelID, x, y+(modelID-1)*dist, w, h);
if (annot != null)
{
annot.Tag = "GdPicture custom annotation";
}
}
//The BurnAnnotationsToPage() method renders your custom anotations on the page using the annotationManager_OnCustomAnnotationPaint() event.
if ((annotationManager.SaveAnnotationsToPage() == GdPictureStatus.OK) &&
(annotationManager.BurnAnnotationsToPage(true, false) == GdPictureStatus.OK) &&
(annotationManager.SaveDocumentToPDF("custom.pdf") == GdPictureStatus.OK))
{
//You also need to implement the GdViewer1_OnCustomAnnotationPaint() event, in the same way,
//to be able to see the added custom annotations in the viewer.
GdViewer1.Refresh();
}
}
if (annotationManager.GetStat() != GdPictureStatus.OK)
MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.AddCustomAnnot");
}
else
MessageBox.Show("Error! Status: " + GdViewer1.GetStat().ToString(), "AnnotationManager.AddCustomAnnot");