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.
ComPDF SDK supports importing and exporting form data in xfdf format to facilitate the management of data in PDF documents.
Imports the form data from the specified XFDF file into the current PDF document.
The API only imports form data and modifies the form content through the corresponding form name.
const pdfReaderRef = useRef<CPDFReaderView>(null);
<CPDFReaderView
ref={pdfReaderRef}
document={samplePDF}
configuration={ComPDFKit.getDefaultConfig({})}
/>
const xfdfFile = '/data/user/0/com.compdfkit.reactnative.example/xxx/xxx.xfdf';
// or use Uri on the Android Platform.
const xfdfFile = 'content://xxxx';
const result = await pdfReaderRef.current.importWidgets(xfdfFile);exports the form data from the current PDF document to an XFDF file.
const pdfReaderRef = useRef<CPDFReaderView>(null);
<CPDFReaderView
ref={pdfReaderRef}
document={samplePDF}
configuration={ComPDFKit.getDefaultConfig({})}
/>
const exportXfdfFilePath = await pdfReaderRef.current?.exportWidgets();