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);
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 False — QueryFieldMapName 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.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
AField | Target field handle. |
Value | Output: the map name (always narrow/ANSI, per description). |
Unicode | Output: 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)
public static extern int pdfGetFieldMapName(IntPtr IPDF, uint AField, ref IntPtr Value, [MarshalAs(UnmanagedType.Bool)] ref bool Unicode);
Forms
pdfGetFieldMapName
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.