Annotations not saving

Questions, comments and suggestions concerning VintaSoft Annotation .NET Plug-in.

Moderator: Alex

Post Reply
pvanderwest
Posts: 8
Joined: Wed Apr 02, 2014 3:08 am

Annotations not saving

Post by pvanderwest » Wed Apr 02, 2014 3:54 am

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)

pvanderwest
Posts: 8
Joined: Wed Apr 02, 2014 3:08 am

Re: Annotations not saving

Post by pvanderwest » Wed Apr 02, 2014 4:14 am

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.

pvanderwest
Posts: 8
Joined: Wed Apr 02, 2014 3:08 am

Re: Annotations not saving

Post by pvanderwest » Wed Apr 02, 2014 4:32 am

One more...

I added the following but it still does not work:

Code: Select all

encoder.Settings.GenerateAnnotationAppearance = True

Alex
Site Admin
Posts: 1443
Joined: Thu Jul 10, 2008 2:21 pm

Re: Annotations not saving

Post by Alex » Wed Apr 02, 2014 11:02 am

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

pvanderwest
Posts: 8
Joined: Wed Apr 02, 2014 3:08 am

Re: Annotations not saving

Post by pvanderwest » Wed Apr 02, 2014 5:51 pm

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?

Alex
Site Admin
Posts: 1443
Joined: Thu Jul 10, 2008 2:21 pm

Re: Annotations not saving

Post by Alex » Wed Apr 02, 2014 7:45 pm

Yes, please send us (to support@vintasoft.com) your PDF documents, we need reproduce the issue.

Best regards, Alexander

pvanderwest
Posts: 8
Joined: Wed Apr 02, 2014 3:08 am

Re: Annotations not saving

Post by pvanderwest » Thu Apr 03, 2014 12:30 am

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.

Alex
Site Admin
Posts: 1443
Joined: Thu Jul 10, 2008 2:21 pm

Re: Annotations not saving

Post by Alex » Thu Apr 03, 2014 3:59 pm

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

Alex
Site Admin
Posts: 1443
Joined: Thu Jul 10, 2008 2:21 pm

Re: Annotations not saving

Post by Alex » Mon Apr 07, 2014 9:35 am

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest