BOOL32 __stdcall pdfSaveFDFDataA(PPDF IPDF, const char* FileName, UI32 Flags);
BOOL32 __stdcall pdfSaveFDFDataW(PPDF IPDF, const wchar_t* FileName, UI32 Flags);
function pdfSaveFDFDataA(const IPDF: PPDF; const FileName: PAnsiChar; Flags: Cardinal): LongBool; stdcall;
function pdfSaveFDFDataW(const IPDF: PPDF; const FileName: PWideChar; Flags: Cardinal): LongBool; stdcall;
Purpose. Export the document's CURRENT form field values as an FDF or XFDF file — the writing half of pdfLoadFDFData.
Description. Walks every terminal form field the document holds — fields created in this session and fields brought in by an import alike — and writes one record per named field: the field's /T and its current value (/V; string values as text, name values such as a checkbox on-state by their name). Flags selects the format: 0 writes classic FDF (%FDF-1.2, a /Fields array of /T//V pairs, parentheses and backslashes escaped), 1 writes XFDF (UTF-8 XML, field name=/value elements, XML metacharacters escaped). The output is round-trip compatible: loading the exported FDF back into an empty copy of the same form via pdfLoadFDFData restores every value. Field values only — annotations are not part of either format's import path (matching the reader half).
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
FileName | Output path for the .fdf / .xfdf file. |
Flags | 0 = FDF, 1 = XFDF. |
Return value. True once the file is written; False if the document holds no named fields, the path cannot be written, or the handle is invalid.
See also. pdfLoadFDFData, pdfLoadFDFDataEx.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfSaveFDFDataW
pdfSaveFDFDataA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.