SI32 __stdcall pdfRenderXFAForm(PPDF IPDF);
SI32 __stdcall pdfXFAFormPageCount(PPDF IPDF);
SI32 __stdcall pdfSetXFARenderMode(PPDF IPDF, SI32 Mode);
SI32 __stdcall pdfSetXFAExpandMode(PPDF IPDF, SI32 Mode);
SI32 __stdcall pdfSetXFAScriptEnabled(PPDF IPDF, SI32 Enabled);
SI32 __stdcall pdfGetXFALastErrorA(PPDF IPDF, char* Buf, SI32 BufLen);
SI32 __stdcall pdfGetXFALastErrorW(PPDF IPDF, wchar_t* Buf, SI32 BufLen);
function pdfRenderXFAForm(const IPDF: PPDF): Integer; stdcall;
function pdfXFAFormPageCount(const IPDF: PPDF): Integer; stdcall;
function pdfSetXFARenderMode(const IPDF: PPDF; Mode: Integer): Integer; stdcall;
function pdfSetXFAExpandMode(const IPDF: PPDF; Mode: Integer): Integer; stdcall;
function pdfSetXFAScriptEnabled(const IPDF: PPDF; Enabled: Integer): Integer; stdcall;
function pdfGetXFALastErrorA(const IPDF: PPDF; Buf: PAnsiChar; BufLen: Integer): Integer; stdcall;
function pdfGetXFALastErrorW(const IPDF: PPDF; Buf: PWideChar; BufLen: Integer): Integer; stdcall;
Purpose. Drive the XFA dynamic-form engine explicitly: render the imported XFA form into PDF pages, pre-flight its page count, choose render/expand behavior, control scripting, and read the engine's last error message.
Purpose of each.
| Function | What it does |
|---|---|
pdfRenderXFAForm | Runs the XFA engine over the open import's XFA package and lays the form out into regular PDF pages in the current document. |
pdfXFAFormPageCount | Pre-flight: how many pages the render WOULD produce, without producing them. |
pdfSetXFARenderMode | 0/1: selects the render mode. Returns the PREVIOUS mode; -3 for an out-of-range value. |
pdfSetXFAExpandMode | 0/1: selects how growable subforms expand. Returns the PREVIOUS mode; -3 for an out-of-range value. |
pdfSetXFAScriptEnabled | Enables (<>0) or disables (0) XFA script execution during the render. Returns the PREVIOUS state as 0/1. |
pdfGetXFALastErrorA/W | Copies the engine's last error text into Buf and returns its length; a two-call size-then-fetch pattern works with a NULL buffer. |
Return value. pdfRenderXFAForm and pdfXFAFormPageCount answer a page count, or a negative engine error code (read the message via pdfGetXFALastError); -1 also covers an invalid document handle. The mode setters and the error query answer as listed above.
See also. the XFA form-field property calls documented earlier in this chapter (pdfGetXFAFormFieldValue and family).
C# (P/Invoke)
public static extern int pdfRenderXFAForm(IntPtr IPDF);
Core
pdfRenderXFAForm
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.