Page 1 of 1

Annotations not saving

Posted: Wed Apr 02, 2014 3:54 am
by pvanderwest
I have pasted the sample code provided into a project and the annotations are not saving onto the pdf:

Code: Select all

' create image collection
Dim images As New ImageCollection()
' create annotation controller associated with image collection
Dim annotations As New AnnotationDataController(images)
' load PDF file into collection
images.Add("G:\Projects_Sample\_Samples\_1TESTDOCUMENT.pdf")

' get the annotation collection for selected image
Dim imageAnnotations As AnnotationDataCollection = annotations(images.Count - 1)
' create new annotation
Dim anno As New RectangleAnnotationData()
anno.Size = New SizeF(300, 300)
anno.FillBrush = New AnnotationSolidBrush(Color.AliceBlue)
anno.Location = New PointF(0, 0)
' add new annotation into annotation collection
imageAnnotations.Add(anno)

Dim encoder As New PdfEncoder()
' specify that annotations must be saved with image collection
encoder.AnnotationsFormat = AnnotationsFormat.VintasoftBinary
' save image collection synchronously to new file
images.SaveSync("G:\Projects_Sample\_Samples\_1TEST." & Format(Now(), "yyyyMMddhhmmss") & ".pdf", encoder)

Re: Annotations not saving

Posted: Wed Apr 02, 2014 4:14 am
by pvanderwest
Some additional information...

If I open the PDF in Adobe Reader, the annotation does not show. If I open it in the VintaSoft Viewer it does.

Re: Annotations not saving

Posted: Wed Apr 02, 2014 4:32 am
by pvanderwest
One more...

I added the following but it still does not work:

Code: Select all

encoder.Settings.GenerateAnnotationAppearance = True

Re: Annotations not saving

Posted: Wed Apr 02, 2014 11:02 am
by Alex
Hello,

We have tested your code and have found it correct. Your code adds annotation to the last page of PDF document:

Code: Select all

annotations(images.Count - 1)
Are you sure that you want to add annotation to the last page of PDF document?

Best regards, Alexander

Re: Annotations not saving

Posted: Wed Apr 02, 2014 5:51 pm
by pvanderwest
There is only 1 page in the PDF.

I believe the issue is that even though the annotation is added, it is not being displayed when the PDF is opened in Adobe Reader. Can I send you the PDF before and after?

Re: Annotations not saving

Posted: Wed Apr 02, 2014 7:45 pm
by Alex
Yes, please send us (to support@vintasoft.com) your PDF documents, we need reproduce the issue.

Best regards, Alexander

Re: Annotations not saving

Posted: Thu Apr 03, 2014 12:30 am
by pvanderwest
I have uploaded the file to dropbox if you want to take a look:

https://dl.dropboxusercontent.com/u/216 ... 062749.pdf

In the Annotation Viewer, the annotations show. In Adobe Reader they do not.

Re: Annotations not saving

Posted: Thu Apr 03, 2014 3:59 pm
by Alex
Hello,

Thank you for PDF document. Your PDF document contains rectangle annotation without PDF annotation appearance, such document could be generated only if you disabled generation of PDF annotation appearance. Unfortunately, we cannot reproduce the issue using your code. Please send us (to support@vintasoft.com) a small working project which demonstrates the issue.

Best regards, Alexander

Re: Annotations not saving

Posted: Mon Apr 07, 2014 9:35 am
by Alex
Hello Pierre,

Your project has references to the following DLLs:
  • Vintasoft.Imaging.dll - allows to work with images
  • Vintasoft.Annotation.dll - allows to annotate images and save annotations as VintaSoft binary, VintaSoft XMP or WANG packet
  • Vintasoft.PDF.dll - allows to read/write PDF documents
You also need add reference to Vintasoft.Annotation.Pdf.dll, this assembly allows to generate PDF annotation appearance and the assembly is necessary if you want to view saved annotations in Adobe PDF Reader.

Best regards, Alexander