PDFium Delphi Component Docs

ImportFDF method

Component: TPdf  ·  Unit: PDFium
Reads an FDF document from a file or stream and applies its hierarchical form field values to matching widget annotations in the loaded PDF

Syntax

function ImportFDF(const FileName: string): Integer; overload;
function ImportFDF(Stream: TStream): Integer; overload;

Description

ImportFDF parses the FDF root and field dictionaries defined by ISO 32000-1 section 12.7.11, rebuilds qualified names from nested /Kids and matches those names against widget annotations on every page

Field values may be direct or indirect objects and may use escaped literal strings, hexadecimal strings, PDFDocEncoding, BOM-prefixed UTF-16BE or UTF-16LE text, PDF name values or explicit empty values

An explicit empty value clears the matching field, whilst a missing or null value leaves it unchanged

Returns the number of top-level FDF field entries parsed

Safety and limits

Remarks

Example

// Import FDF field values and save the updated PDF
Imported := Pdf1.ImportFDF('C:\Data\form.fdf');
Pdf1.SaveAs('C:\Data\form_filled.pdf');

See Also

ExportFDF, ImportXFDF, FPdfXfdf, FormFieldInfo