Burning Annotation is not working

Discussions about annotation support.
Post Reply
marco
Posts: 12
Joined: Mon Sep 17, 2018 11:57 am

Burning Annotation is not working

Post by marco » Thu May 09, 2019 7:14 pm

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

Gabriela
Posts: 436
Joined: Wed Nov 22, 2017 9:52 am

Re: Burning Annotation is not working

Post by Gabriela » Fri May 10, 2019 1:59 pm

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.
Attachments
f51t6458_1.pdf
(59.22 KiB) Downloaded 520 times
f51t6458.pdf
(59.25 KiB) Downloaded 521 times

marco
Posts: 12
Joined: Mon Sep 17, 2018 11:57 am

Re: Burning Annotation is not working

Post by marco » Fri May 10, 2019 2:59 pm

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

marco
Posts: 12
Joined: Mon Sep 17, 2018 11:57 am

Re: Burning Annotation is not working

Post by marco » Fri May 10, 2019 3:48 pm

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

Gabriela
Posts: 436
Joined: Wed Nov 22, 2017 9:52 am

Re: Burning Annotation is not working

Post by Gabriela » Mon May 13, 2019 1:28 pm

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.

Gabriela
Posts: 436
Joined: Wed Nov 22, 2017 9:52 am

Re: Burning Annotation is not working

Post by Gabriela » Thu May 16, 2019 1:48 pm

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.

marco
Posts: 12
Joined: Mon Sep 17, 2018 11:57 am

Re: Burning Annotation is not working

Post by marco » Wed May 29, 2019 10:00 am

Hello Gabriela.
I can confirm it is working with 14.1.20.
Thank you.
Kind regards, Marco

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Burning Annotation is not working

Post by Loïc » Wed May 29, 2019 7:18 pm

Thanks for the return Marco!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest