API referenceForms

pdfGetFieldType

Return a field's TFieldType ordinal (Text/Button/Choice/

C
int32_t __stdcall pdfGetFieldType(PPDF IPDF, uint32_t AField);
int32_t __stdcall pdfGetFieldGroupType(PPDF IPDF, uint32_t AField);
Delphi
function pdfGetFieldType(const IPDF: PPDF; AField: Cardinal): Integer; stdcall;
function pdfGetFieldGroupType(const IPDF: PPDF; AField: Cardinal): Integer; stdcall;

Purpose. Return a field's TFieldType ordinal (Text/Button/Choice/ Signature/etc).

Description. Verified: pdfGetFieldType and pdfGetFieldGroupType are the literal identical implementation (GetFieldTypeH) — despite the "Group" name suggesting a different, group-node-specific type enumeration, pdfGetFieldGroupType returns exactly the same value as pdfGetFieldType for any field, group node or otherwise. The one observable difference is their invalid-IPDF fallback: pdfGetFieldType returns -1 when IPDF is invalid, while pdfGetFieldGroupType returns 0 in the same case — a minor but real divergence in error signaling between two otherwise-identical functions.

Parameters.

ParameterDescription
IPDFDocument handle.
AFieldTarget field handle.

Return value. The TFieldType ordinal; pdfGetFieldType returns -1 and pdfGetFieldGroupType returns 0 when IPDF is invalid — the only difference between the two.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfGetFieldType(IntPtr IPDF, uint AField);
Area
Forms
Category

Forms

Exported names

pdfGetFieldType

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.