Skip to content
ComPDF
、

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

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()