pdfSetXFAFormFieldBorderColor
Get/set a template field's border/edge/color value —
int32_t __stdcall pdfGetXFAFormFieldBorderColorA(PPDF IPDF, const char* Name);
int32_t __stdcall pdfGetXFAFormFieldBorderColorW(PPDF IPDF, const wchar_t* Name);
int32_t __stdcall pdfSetXFAFormFieldBorderColorA(PPDF IPDF, const char* Name, int32_t Color);
int32_t __stdcall pdfSetXFAFormFieldBorderColorW(PPDF IPDF, const wchar_t* Name, int32_t Color);
function pdfGetXFAFormFieldBorderColorA(const IPDF: PPDF; Name: PAnsiChar): Integer; stdcall;
function pdfGetXFAFormFieldBorderColorW(const IPDF: PPDF; Name: PWideChar): Integer; stdcall;
function pdfSetXFAFormFieldBorderColorA(const IPDF: PPDF; Name: PAnsiChar; Color: Integer): Integer; stdcall;
function pdfSetXFAFormFieldBorderColorW(const IPDF: PPDF; Name: PWideChar; Color: Integer): Integer; stdcall;
Purpose. Get/set a template field's border/edge/color value — the field widget's edge (border) color, as an RGB triple.
Description. Walks <field name="Name"> → <border> → <edge> → <color value="r,g,b"> (creating the border/edge/color chain on set if missing, via LumasXfaEnsureChild). The XFA "r,g,b" decimal string is converted to/from a packed Integer by XfaColorFromTriple/XfaTripleFromColor: the packing is R | (G shl 8) | (B shl 16) (red in the low byte) — the reverse byte order from the standard 0xRRGGBB convention used by most other color parameters in this SDK (e.g. pdfSetFieldBackColor, Field Appearance and Style). Passing a pdfSetFieldColor-style 0xRRGGBB value here would swap red and blue. If any of r/g/b fails to parse as an integer, or fewer than 3 comma-separated parts are present, XfaColorFromTriple returns -1 (the same sentinel used for "no color found at all") — a genuine parse failure is indistinguishable from an absent color element.
Parameters.
| Parameter | Description | ||
|---|---|---|---|
IPDF | Document handle. | ||
Name | The template field's name attribute. | ||
Color | RGB packed as **`R \ | (G shl 8) \ | (B shl 16)** — not 0xRRGGBB`. |
Return value. Getter: the packed color, -1 if Name doesn't resolve, the field has no border/edge/color chain, or the stored value fails to parse. Setter: 1 on success; 0 if Name doesn't resolve.
C# (P/Invoke)
public static extern int pdfSetXFAFormFieldBorderColorW(IntPtr IPDF, IntPtr Name, int Color);
public static extern int pdfSetXFAFormFieldBorderColor(IntPtr IPDF, IntPtr Name, int Color);
public static extern int pdfSetXFAFormFieldBorderColorA(IntPtr IPDF, IntPtr Name, int Color);
Setters
pdfSetXFAFormFieldBorderColorW
pdfSetXFAFormFieldBorderColor
pdfSetXFAFormFieldBorderColorA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.