XFDF is an XML-like standard from Adobe XFDF (ISO 19444-1:2016) for encoding annotations and forms. It’s compatible with Adobe Acrobat and several other third-party frameworks.
ℹ️ Note: XFDF has various limitations. In most cases, using PSPDFKit Instant will result in a smaller file and better synchronization.
PSPDFKit Server supports importing XFDF files on document upload and exporting XFDF from an existing PDF. Our
POST /documents endpoint for uploading documents now supports the import of an XFDF file, and we also offer a
GET /document.xfdf endpoint to export the current state of a document into an XFDF file.
PSPDFKit Server supports importing annotations from an XFDF file when uploading a document via the
/api/documents endpoint. Send a
POST request including the PDF and the XFDF file to import the annotations in the given PDF file. This will replace all existing annotations in the uploaded PDF with the annotations from the uploaded Instant JSON file. If you want to add annotations to already existing ones instead of replacing them, you can set
POST /api/documents Content-Type: multipart/form-data; boundary=customboundary Authorization: Token token="<secret token>" --customboundary Content-Disposition: form-data; name="file"; filename="Example Document.pdf" Content-Type: application/pdf <PDF data> --customboundary Content-Disposition: form-data; name="attachment"; filename="attachment.xfdf" Content-Type: application/vnd.adobe.xfdf <annotations data> --customboundary Content-Disposition: form-data; name="keep_current_annotations" true --customboundary--
You can export the current annotations of a document as an XFDF file via a
GET request to
/api/documents/:document_id/document.xfdf. To get the current annotation of a document’s layer, send a
GET request to
GET /api/documents/:document_id/document.xfdf Authorization: Token token="<secret token>"
$ curl "http://localhost:5000/api/documents/abc/document.xfdf" \ -H "Authorization: Token token=<secret token>"
HTTP/1.1 200 OK Content-Type: application/vnd.adobe.xfdf <XFDF data>
Adobe Acrobat can export annotations into XFDF. The export menu is part of the Comments tool and is accessed by opening the tool in the sidebar.
You can access the export function by clicking on the three dots and then choosing Export All To Data File.
At the bottom of the page, choose Acrobat XFDF Files.
Select the directory you wish to save the XFDF file to and name the file.
A successful export will result in a file with an
The export function is part of the Comments tool and is accessed by clicking on its icon.
Click on the three dots to open the import menu, and then click on Import Data File.
.xfdf file you wish to import and click Select.
The import function completes with the annotations being placed on the document.
|Damaged/missing document body|
|Damaged/missing description tag|
|Missing document flag|