ExportFormDataToFDF
Form fields
Description
Writes the names and current values of the document's form fields to an FDF file and returns 1 when the file is written, or 0 when the document carries no form data, the path is empty, or the file cannot be created.
Syntax
Delphi
Function TPDFlib.ExportFormDataToFDF(Const FDFFileName: WideString): Integer;
Parameters
FDFFileName is the path of the FDF file to write, using the same Unicode file-name handling as the other file APIs; an existing file is truncated and overwritten, and an empty string makes the call return 0 without touching the disk.
Return values
1 when the file has been written in full. 0 when FDFFileName is empty, when the string form of the export produces nothing because no document is open or the document has no form data, or when the file cannot be created or written — a missing directory, a locked or read-only file, or a full disk.
Remarks
The file is FDF 1.2: a small PDF-syntax document whose /FDF /Fields array holds one << /T (name) /V (value) >> pair per terminal field, so the data can be stored separately from the PDF and merged back with ImportFormDataFromFDF. Non-terminal parent fields and fields without a name are omitted, because an empty /V would clear their children on import; check box and radio button states are written as PDF names, with /Off standing in for an empty value; and a multiple-selection choice is written as an array of strings. Names and values keep PDF text-string encoding, so non-ASCII data survives the round trip. The PDF itself is neither saved nor modified, and the failure return is not accompanied by a new LastErrorCode.