Embed API - Updated annotations are not exported to XFDF
Copy link to clipboard
Copied
I am building an application for modifying and creating annotations using the Embed API. Everything seems to work just fine, except for when I export the pdf data as an XFDF the updated annotations are not present. I have attached a video to show the behavior but had to compress it significantly, here is a breakdown of what happens:
- In my application (the Embed API), I open up a PDF with no comments
- I highlight some text and add a comment, and save the PDF
- I open up the saved PDF in adobe and export the XFDF
- The XFDF has the correct content for the annotation created using the Embed Api (The annotation is of the type <Contents>)
- I add a new annotation in Adobe Reader and save the document
- I export the XFDF and the XFDF has the two annotations
- The Annotation from Embed Api is <Contents>
- The Annotation from Adobe Reader is <Contents-Richtext>
- I open up the saved PDF in my application and update the existing annotation that was created in Adobe Reader
- Save the newly modified PDF
- Open up the PDF in adobe reader
- Can see the updated comment in the comments pane
- Export the XFDF from this file
- The XFDF does not contain the updates that were made from the Embed API
- As a bonus, I exported the FDF file and can see the contents in that file
I would expect the behavior to be the same for both the Embed API and the Adobe Reader.
Copy link to clipboard
Copied
Can you share the PDF files from step 5 and 9? I'll also try to reproduce with my own file.
Copy link to clipboard
Copied
Oh sure, I've attached it here. But any pdf seems to have the same issue. I think it has to do with how in Adobe Reader, comments are saved as <Contents-RichText> and the Embed Api saves them as <Contents> so then when updating, it doesn't correctly apply the updates.
Copy link to clipboard
Copied
I wouldn't be surprised if Reader drops annotations that aren't 100% what it is expecting but that's why I wanted your file and my own test. It's possible that the PDF creation tool has something to do with it. Thanks for the file.
Copy link to clipboard
Copied
@Joel Geraci Any luck getting any further than I did?

