PDFium Component Docs

ImportXFDF method

Component: TPdf  ·  Unit: PDFium
Reads an XFDF (ISO 19444-1) document and applies its fields and annotations to the loaded PDF

Syntax

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

Description

Parses <fields> and <annots> sections in the current PDF

Matches each qualified <field> name to widget annotations and writes its value to /V. Checkbox and radio fields use the export value

Creates each annotation on the page from page and fills Contents, Author, Name NM, Subject, dates, Icon and flags

Returns the number of processed fields and annotations

The rect attribute is mandatory; missing rectangles are skipped

Uses a hand-written XML scanner without an XML DOM dependency

Remarks

Example

// Import field values and annotations from an .xfdf file
Imported := Pdf1.ImportXFDF('C:\Data\form.xfdf');
Pdf1.SaveAs('C:\Data\form_filled.pdf');

See Also

ExportXFDF, CreateAnnotation, Annotation, FormFieldInfo