PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
ComPDFKit supports exporting form field data to XFDF files or importing form data from XFDF files. This is similar to annotation import/export (see Import and Export Annotations), but specifically for form fields (Widget).
You can export form field data to an XFDF file by following these steps:
CPDFDocument document = CPDFDocument.InitWithFilePath("filePath");
document.ExportWidgetToXFDFPath("exportPath.xfdf", "tempPath");You can import form field data from an XFDF file to the document by following these steps:
CPDFDocument document = CPDFDocument.InitWithFilePath("filePath");
document.ImportWidgetFromXFDFPath("importPath.xfdf", "tempPath");In addition to exporting form fill values, you can also export complete Widget properties (including position, style, font, color, and all other configuration information). This is useful when you need to fully backup or migrate form structures.
CPDFDocument document = CPDFDocument.InitWithFilePath("filePath");
document.ExportCustomWidgetFromXFDFPath("exportPath.xfdf", "tempPath");You can import complete Widget properties from an XFDF file to the document:
CPDFDocument document = CPDFDocument.InitWithFilePath("filePath");
document.ImportCustomWidgetFromXFDFPath("importPath.xfdf", "tempPath");| Function | Method | Description |
|---|---|---|
| Form fill values import/export | ImportWidgetFromXFDFPath / ExportWidgetToXFDFPath | Only import/export form field fill values (user-entered data) |
| Complete form properties import/export | ImportCustomWidgetFromXFDFPath / ExportCustomWidgetFromXFDFPath | Import/export complete Widget properties (position, style, configuration, etc.) |