Search results

DataFormat API in JavaScript PDF API control

Public Enum to define export or import data format.

// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Sets export data format as JSON type to annotation export settings
let settings: PdfAnnotationExportSettings = new PdfAnnotationExportSettings();
settings.dataFormat = DataFormat.json;
// Export annotations to JSON format
let json: Uint8Array = document.exportAnnotations(settings);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();
  • fdf - Specifies the intent of FDF.
  • json - Specifies the intent of JSON.
  • xfdf - Specifies the intent of XFDF.
  • xml - Specifies the intent of XML.