XFDF is an XML-like standard from Adobe XFDF for encoding annotations and forms (see this XFDF overview). It is compatible with Adobe Acrobat and several other third-party frameworks.
ℹ️ Note: XFDF has various limitations. In most cases, using PSPDFKit Instant or Instant JSON will result in a smaller file and better synchronization.
XFDF works seamlessly with the annotation API. If you want to persist annotations whenever changes are made, we recommend you use the
annotations.didSave event. This event will be triggered automatically and can be configured via
Note for standalone users: Instead of saving annotations to the backend, a save operation will persist the annotations in memory until they are either exported via
Instance#exportXFDF or written to the PDF document when you export it using
Instance#exportPDF. Unsaved annotations will not be exported, in order to reflect the server behavior:
To import XFDF when using standalone deployment, you can use the
Configuration#XFDF option. When opening a document with Instant JSON using our standalone setup, make sure you always use the same unmodified PDF that was used to create that Instant JSON.
In addition to the
Configuration#XFDF option, you can also set the
Configuration#XFDFKeepCurrentAnnotations flag. This flag will make sure annotations that are already in the source PDF are kept and not replaced with those defined in the XFDF:
When you upload a new document to PSPDFKit Server, you can include an XFDF document as a second file in the upload. Follow the server guides for an in-depth example.