Page 1 of 1

Burning Annotation is not working

Posted: Thu May 09, 2019 7:14 pm
by marco
Hello,
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)
2. Autosize my text

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
3. Storing my pdf with the annotions that should be burned:

Code: Select all

            gdv.BurnAnnotationsToPage(True, True)
            gdv.SaveAnnotationsToPage()
            gdv.SaveDocumentToPDF("New.pdf")
Doing this, my annotations are not burned into the 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

Re: Burning Annotation is not working

Posted: Fri May 10, 2019 1:59 pm
by Gabriela
Hi, Marco,

I have just tried your code using the latest release and here are both resulting documents, one with AutoSize property and the other without. Everything works as expected. Could you confirm you are using the latest published release 14.1.18? May I ask you to try with that release? Thank you.
Let us know if it works for you.

Re: Burning Annotation is not working

Posted: Fri May 10, 2019 2:59 pm
by marco
Hello Gabriela,
I have found my issue. If I have a multipage pdf I need to iterate through all pages and call "gdv.BurnAnnotationsToPage(True, True)", otherwise the annotation will not be burned.
Doing that it works now fine.
Thank you.

Kind regards, Marco

Re: Burning Annotation is not working

Posted: Fri May 10, 2019 3:48 pm
by marco
Hello Gariela,

I have a new issue. I already use 14.1.0.18.

If I add a FreeHandAnnot using

Code: Select all

gdv.AddFreeHandAnnotInteractive(Colors.Blue, 0.02F, System.Drawing.Drawing2D.LineCap.Round, System.Drawing.Drawing2D.LineCap.Round, 1, False)
this annot will not be stored if step 2 (autosize my text - see below) is enabled.
There are two methods the annotation is saved:

1. I disable step 2.
OR
2. Step 2 is enabled and I select the FreeHandAnnot with my mouse after adding it and move the annot a bit.

Doing one of these the annot is saved, otherwise it is lost after saving the file.

Kind regards,
Marco

Re: Burning Annotation is not working

Posted: Mon May 13, 2019 1:28 pm
by Gabriela
Hello, Marco,

Thank you for reporting this. We have been able to reproduce the issue, it is currently in hands of the development team to find a reason or a bug. I will update you with more details as they come.

Re: Burning Annotation is not working

Posted: Thu May 16, 2019 1:48 pm
by Gabriela
Hi, Marco,

The issue you have reported is fixed and will be available in the 14.1.20 release.
Thanks for pointing this to us.

Re: Burning Annotation is not working

Posted: Wed May 29, 2019 10:00 am
by marco
Hello Gabriela.
I can confirm it is working with 14.1.20.
Thank you.
Kind regards, Marco

Re: Burning Annotation is not working

Posted: Wed May 29, 2019 7:18 pm
by Loïc
Thanks for the return Marco!