# Import and Export

# Annotation

The Annotation supports three types of files to import/export data: XFDF, FDF and JSON. The following table lists the what annotations currently don't support to import/export.

File Type If all annots support What not support
XFDF/FDF Mostly Link
JSON Mostly Screen Image, Link, Sound

# API

The following table list APIs that Foxit PDF SDK for Web provides to import/export data file.

Method XFDF/FDF JSON JSON
Import PDFDoc.importAnnotsFromFDF() PDFDoc.importAnnotsFromJSON(annotsJson) PDFPage.AddAnnot(annotJson)
Export PDFDoc.exportAnnotsToFDF() PDFDoc.exportAnnotsToJSON() Annot.exportToJson()

Where the PDFPage.AddAnnot(annotJson) and Annot.exportToJson() doesn't support binary data。If you have the following usage scenarios:

  1. use PDFDoc.exportAnnotsToJSON() to export to data file from a source PDF
  2. use PDFPage.AddAnnot(annotJson) to add annotations to the PDF by copying the above exported data.

it is recommended that you make adjustments based on the annotations.

If your source PDF contains Stamp and/or fileAttachment, the exported data will contain binary data. While the PDFpage.addannot()does not support binary data. As such, the above use case will result in the Appearance of some comments not showing, such as Stamp, or attachment files losing, such as fileAttachment.

# Annotations that contains binary data

  • Stamp
  • fileAttachment

# Form

The Form supports three standard types of files to import/export data: XFDF, FDF and XML.

# API

The following table list APIs that Foxit PDF SDK for Web provides to import/export data file.

  • PDFDoc.exportFormToFile(fileType)
  • PDFDoc.importFormFromFile(file, isXML)