use of com.tom_roush.pdfbox.pdmodel.fdf.FDFCatalog in project PdfBox-Android by TomRoush.
the class PDAcroForm method exportFDF.
/**
* This will export all FDF form data.
*
* @return An FDF document used to export the document.
* @throws IOException If there is an error when exporting the document.
*/
public FDFDocument exportFDF() throws IOException {
FDFDocument fdf = new FDFDocument();
FDFCatalog catalog = fdf.getCatalog();
FDFDictionary fdfDict = new FDFDictionary();
catalog.setFDF(fdfDict);
List<FDFField> fdfFields = new ArrayList<FDFField>();
List<PDField> fields = getFields();
for (PDField field : fields) {
fdfFields.add(field.exportFDF());
}
fdfDict.setID(document.getDocument().getDocumentID());
if (!fdfFields.isEmpty()) {
fdfDict.setFields(fdfFields);
}
return fdf;
}
Aggregations