API referenceForms

pdfGetFieldName

Get/set a field's partial name (/T) — the segment

C
int32_t __stdcall pdfGetFieldName(PPDF IPDF, uint32_t AField, const char* Name);
BOOL32 __stdcall pdfSetFieldNameA(PPDF IPDF, uint32_t AField, const char* NewName);
BOOL32 __stdcall pdfSetFieldNameW(PPDF IPDF, uint32_t AField, const wchar_t* NewName);
Delphi
function pdfGetFieldName(const IPDF: PPDF; AField: Cardinal; var Name: PAnsiChar): Integer; stdcall;
function pdfSetFieldNameA(const IPDF: PPDF; AField: Cardinal; NewName: PAnsiChar): LongBool; stdcall;
function pdfSetFieldNameW(const IPDF: PPDF; AField: Cardinal; NewName: PWideChar): LongBool; stdcall;

Purpose. Get/set a field's partial name (/T) — the segment specific to this field node, not the fully-qualified dotted path (see pdfGetFullyQualifiedFieldName below).

Description. **pdfGetFieldName's Name parameter is an output-only var PAnsiChar despite its misleading const char* C declaration** — the same disguised-output pattern confirmed repeatedly throughout this manual (pdfGetSeparationInfo, Separation Color Spaces, DeviceN Attributes, OCG UI Tree, and PDF Collections; pdfGetContent, Miscellaneous Content Access, Style Removal, Page Decorations, and Analysis).

Parameters.

ParameterDescription
IPDFDocument handle.
AFieldTarget field handle.
NameOutput only — the field's partial name.
NewName*(Set only)* New partial name.

Return value. pdfGetFieldName: name length; 0 if AField doesn't resolve. pdfSetFieldName: True on success.

See also. pdfGetFullyQualifiedFieldName.

C# (P/Invoke)

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

Forms

Exported names

pdfGetFieldName

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.