Skip to content
ComPDF
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

Import or Export Annotations

If you want to import or export annotations as XFDF, you can use exportPDF and importAnnotations.

Import Annotations

After the document is loaded, you can import the annotations of XFDF with importAnnotations, and the type of XFDF can be String or File

javascript
const annotationManager = await docViewer.importAnnotations(xfdf)

Export Annotations

After the document is loaded, you can export annotations with exportPDF as XFDF string.

javascript
const xfdfString = await docViewer.exportXfdf()