pdfSetXFAFormFieldBorderPresence
Get/set a template field's border/edge presence
const char* __stdcall pdfGetXFAFormFieldBorderPresenceA(PPDF IPDF, const char* Name);
const wchar_t* __stdcall pdfGetXFAFormFieldBorderPresenceW(PPDF IPDF, const wchar_t* Name);
int32_t __stdcall pdfSetXFAFormFieldBorderPresenceA(PPDF IPDF, const char* Name, const char* Presence);
int32_t __stdcall pdfSetXFAFormFieldBorderPresenceW(PPDF IPDF, const wchar_t* Name, const wchar_t* Presence);
function pdfGetXFAFormFieldBorderPresenceA(const IPDF: PPDF; Name: PAnsiChar): PAnsiChar; stdcall;
function pdfGetXFAFormFieldBorderPresenceW(const IPDF: PPDF; Name: PWideChar): PWideChar; stdcall;
function pdfSetXFAFormFieldBorderPresenceA(const IPDF: PPDF; Name, Presence: PAnsiChar): Integer; stdcall;
function pdfSetXFAFormFieldBorderPresenceW(const IPDF: PPDF; Name, Presence: PWideChar): Integer; stdcall;
Purpose. Get/set a template field's border/edge presence attribute (XFA's visible/hidden/inactive/invisible edge-display toggle).
Description. Same <field> → <border> → <edge> chain as the color function above, reading/writing the edge element's presence attribute directly (no value translation). Defaults to 'visible' if the field has a border/edge chain but no explicit presence attribute — matching the XFA spec default — but returns empty if the field itself, or its border/edge chain, doesn't exist at all (these two "no value" cases are otherwise indistinguishable from the API alone).
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Name | The template field's name attribute. |
Presence | *(Set only)* New presence string, written verbatim. |
Return value. Getter: the presence string ('visible' default, or empty if unresolvable). Setter: 1 on success (creates the border/edge chain if missing); 0 if Name doesn't resolve.
C# (P/Invoke)
public static extern int pdfSetXFAFormFieldBorderPresenceW(IntPtr IPDF, IntPtr Name, IntPtr Presence);
public static extern int pdfSetXFAFormFieldBorderPresence(IntPtr IPDF, IntPtr Name, IntPtr Presence);
public static extern int pdfSetXFAFormFieldBorderPresenceA(IntPtr IPDF, IntPtr Name, IntPtr Presence);
Setters
pdfSetXFAFormFieldBorderPresenceW
pdfSetXFAFormFieldBorderPresence
pdfSetXFAFormFieldBorderPresenceA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.