Skip to end of metadata
Go to start of metadata

A Forms Data Format (FDF) file is a text file used by Adobe Acrobat to hold values exported from PDF forms documents. The Adobe PDF Library views an FDF file as a COS document. As such, it can be opened by the Adobe PDF Library, and can be used with COS-level interfaces.

There are also three special interfaces at the PD level that consume or create FDF documents:

  • PDDocImportCosDocNotes
  • PDDocExportNotes
  • PDDocExportSomeNotes

In essence, PDDocImportCosDocNotesfunctions as an FDF Merge, and PDDocExportNotes (or PDDocExportSomeNotes) functions as an FDF Create from PDF.

  CosDoc exportDoc = PDDocExportNotes(pdDoc1, NULL, NULL, NULL, NULL, NULL, NULL);

  _t_CosDocSaveParams sParams; 
  memset(&sParams, NULL,  sizeof sParams); 
  sParams.size =  sizeof sParams; 
  sParams.header = "%FDF-1.2";

  ASFile fdfFile = NULL; 
  ASFileSys fileSys = ASGetDefaultFileSys(); 
  ASPathName fdfPath = ASFileSysCreatePathName (fileSys, 
ASAtomFromString("Cstring"),"C:\\temp\\out.fdf", 0);

  ASFileSysOpenFile(fileSys, fdfPath, ASFILE_CREATE | ASFILE_WRITE, &fdfFile); 
  CosDocSaveToFile(exportDoc, fdfFile, cosSaveFullSave | cosSaveBinaryOK, &sParams); 
  ASFileSysReleasePath(fileSys, fdfPath);

You can use PDDocExportNotes to create an FDF file, but the export data only applies to text annotations, values stored in fields in a PDF form document. See also section 12.7.7, “Forms Data Format,” in the ISO 32000 Reference, page 456. Find this document on the web store of the International Standards Organization (ISO).

PDF Java Toolkit, another product offered by Datalogics, can work with FDF and XFDF Forms content. The FillForm sample program demonstrates this workflow.

  • No labels