I need to burn added annotations to the pdf. This is not working if I use the .AutoSize.
I do the following:
1. Adding a text annotation (gdv is my GDViewer):
Code: Select all
gdv.AddTextAnnotationInteractive("Sometimes longer Text", Brushes.Red.Color, "Arial", System.Drawing.FontStyle.Bold, 14, True, Brushes.Yellow.Color, Brushes.Yellow.Color, 0.8, 0)
Code: Select all
Dim annotMngr As AnnotationManager = gdv.GetAnnotationManager()
Dim annot As GdPicture14.Annotations.Annotation = Nothing
For i As Integer = 1 To annotMngr.PageCount
If annotMngr.SelectPage(i) = GdPictureStatus.OK Then
For j As Integer = 0 To annotMngr.GetAnnotationCount() - 1
annot = annotMngr.GetAnnotationFromIdx(j)
If annotMngr.GetStat() = GdPictureStatus.OK Then
If annot.GetAnnotationType = Annotation.GdPictureAnnotationType.AnnotationTypeText Then
Dim text_annot As AnnotationText = CType(annot, AnnotationText)
text_annot.AutoSize = True
End If
End If
Next
End If
Next
Code: Select all
gdv.BurnAnnotationsToPage(True, True)
gdv.SaveAnnotationsToPage()
gdv.SaveDocumentToPDF("New.pdf")
If I now delete step 2 then the annotations are burned and everything works good.
What I am doing wrong?
Thanks and cheers, Marco