Saving PDF Annotations Externally

Skip to first unread message


Mar 28, 2014, 6:22:31 PM3/28/14

We would like to allow the user to annotate the PDFs (in some limited way, ink annotations only) but save those annotations to (and of course read them back from) a separate file/resource without augmenting the original PDF (which, for security concerns, should be verifiable vs its original checksum).


PDFNet SDK supports exporting annotations to a format called XFDF.  XFDF annotations can then be re-imported into the document with either the PDFNet SDK or third parties (line Acrobat).  The following blog post has more details:

We also provide sample code showing how to use XFDF.  This sample is included with the SDK (, so you can run it and try out annotation export/import in your environment:

Just to clarify, you do not have to save the PDF to use (or export) XFDF.  You can add annotations to an in-memory copy of the PDF, then export the annotations to an XFDF file without ever saving the modified version of the PDF to disk.  An in-memory copy of a PDF is only written to disk when PDFDoc.Save() is called on it. 

(The PDFNet SDK even supports creating a new PDF in memory, adding content and annotations to it, and exporting the annotations to an XFDF file, all without ever saving the PDF itself to disk.)

Similarly, when viewing the annotated PDF, you aren't required to first save the annotated copy to disk.

Reply all
Reply to author
0 new messages