API referenceForms

pdfSetFieldMapName

Get/set a field's /TM alternate mapping name — used by

C
int32_t __stdcall pdfGetFieldMapName(PPDF IPDF, uint32_t AField, void* Value, BOOL32* Unicode);
BOOL32 __stdcall pdfSetFieldMapNameA(PPDF IPDF, uint32_t AField, const char* Name);
BOOL32 __stdcall pdfSetFieldMapNameW(PPDF IPDF, uint32_t AField, const wchar_t* Name);
Delphi
function pdfGetFieldMapName(const IPDF: PPDF; AField: Cardinal; var Value: Pointer; var Unicode: LongBool): Integer; stdcall;
function pdfSetFieldMapNameA(const IPDF: PPDF; AField: Cardinal; Name: PAnsiChar): LongBool; stdcall;
function pdfSetFieldMapNameW(const IPDF: PPDF; AField: Cardinal; Name: PWideChar): LongBool; stdcall;

Purpose. Get/set a field's /TM alternate mapping name — used by some external tools/scripts instead of the field's real /T name, and excluded from FDF/XML export in favor of the mapping name when present.

Description. pdfGetFieldMapName's output Unicode is always forced to FalseQueryFieldMapName only exposes a narrow (ANSI) form regardless of how the map name was stored, the same one-sided Unicode-always-False limitation already confirmed for pdfGetJavaScript (JavaScript, FDF Import, Usage Rights, and Custom Data) — while the two setters genuinely accept both ANSI and Wide input.

Parameters.

ParameterDescription
IPDFDocument handle.
AFieldTarget field handle.
ValueOutput: the map name (always narrow/ANSI, per description).
UnicodeOutput: always False.
Name*(Set only)* New map name.

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

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Forms
Category

Forms

Exported names

pdfSetFieldMapNameA pdfSetFieldMapNameW

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.