THotPDF.ExportLoadedFormToXFDF Method

Exports named loaded form fields (AcroForm) to an XML Forms Data Format (XFDF) file

Scalar field values retain their exact text, including empty values, leading and trailing spaces, tabs, and line breaks; XML formatting is kept outside the value elements

Export uses the effective inherited value and preserves the existing AnsiString representation; multi-selection arrays produce a separate value element for each selected item, including items containing line breaks

An empty value array is exported as an explicit empty value element when the option list contains no empty export value; if an empty export value is also a valid option, export rejects this ambiguous empty array before creating the output file, and FDF can be used to retain it explicitly

Custom low-level integrations can use the HPDFXFDFExportFields overload with a separate, initialized THPDFXFDFArrayAccess record; its getter returns true only for an array value and supplies a THPDFXFDFValueArray, while the original access record and overload keep their existing layout and scalar behavior

Syntax

function ExportLoadedFormToXFDF(const AFileName: TFileName): Integer;

Parameters

AFileName: TFileName
The output file name where the XFDF data will be saved

Return Value

Returns the number of named fields exported, including signature fields without value elements; a zero count leaves the output file untouched, and file I/O failures raise exceptions