API referenceForms

pdfSetXFAFormFieldBorderWidth

Get/set a template field's border/edge thickness

C
double __stdcall pdfGetXFAFormFieldBorderWidthA(PPDF IPDF, const char* Name);
double __stdcall pdfGetXFAFormFieldBorderWidthW(PPDF IPDF, const wchar_t* Name);
int32_t __stdcall pdfSetXFAFormFieldBorderWidthA(PPDF IPDF, const char* Name, double Width);
int32_t __stdcall pdfSetXFAFormFieldBorderWidthW(PPDF IPDF, const wchar_t* Name, double Width);
Delphi
function pdfGetXFAFormFieldBorderWidthA(const IPDF: PPDF; Name: PAnsiChar): Double; stdcall;
function pdfGetXFAFormFieldBorderWidthW(const IPDF: PPDF; Name: PWideChar): Double; stdcall;
function pdfSetXFAFormFieldBorderWidthA(const IPDF: PPDF; Name: PAnsiChar; Width: Double): Integer; stdcall;
function pdfSetXFAFormFieldBorderWidthW(const IPDF: PPDF; Name: PWideChar; Width: Double): Integer; stdcall;

Purpose. Get/set a template field's border/edge thickness attribute (edge line width).

Description. Verified unit-conversion gap: the getter does not interpret the XFA thickness unit suffix at all. XfaWidthFromThickness scans the stored string (e.g. "1pt", "2.5mm") and simply takes the leading numeric run (0-9, ., -, +) up to the first non-numeric character, discarding everything after — it never checks whether the suffix is pt, mm, cm, or in, so a thickness authored in any non-pt unit is returned as if its bare number were already in points (e.g. "2mm" returns 2.0, not the ~5.67pt that unit would actually represent). The setter has the opposite one-sidedness: it always writes back with a hardcoded pt suffix (Format('%gpt', [Width], InvariantFormatSettings)), so SetGet round-trips correctly (both sides agree the unit is always points), but reading a template packet authored by another XFA tool using mm/cm/in will silently misinterpret the magnitude.

Parameters.

ParameterDescription
IPDFDocument handle.
NameThe template field's name attribute.
WidthThickness in points — always written with a pt suffix, regardless of what unit a pre-existing value used.

Return value. Getter: the thickness (0 if unset, if Name doesn't resolve, or if there is no border/edge chain — all indistinguishable). Setter: 1 on success; 0 if Name doesn't resolve.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfSetXFAFormFieldBorderWidthW(IntPtr IPDF, IntPtr Name, double Width);
public static extern int pdfSetXFAFormFieldBorderWidth(IntPtr IPDF, IntPtr Name, double Width);
public static extern int pdfSetXFAFormFieldBorderWidthA(IntPtr IPDF, IntPtr Name, double Width);
Area
Forms
Category

Setters

Exported names

pdfSetXFAFormFieldBorderWidthW pdfSetXFAFormFieldBorderWidth pdfSetXFAFormFieldBorderWidthA

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.