| Category | CID/CJK fonts |
|---|---|
| Note | Embed accepted but unused (see Remarks) |
Purpose — Register a predefined CMap name for use with pdfSetCIDFont, returning a stable handle.
Description — Validates CMapName against "Identity-H"/"Identity-V" or this build's bundled predefined-CMap registry (HasPredefinedCMap) — rejects (returns -1) any name not recognized, so this is a real validation, not a pass-through. Idempotent: loading the same name twice returns the same handle.
Declarations
int32_t __stdcall pdfLoadCMap(PPDF IPDF, const char* CMapName, BOOL32 Embed);
function pdfLoadCMap(const IPDF: PPDF; const CMapName: PAnsiChar; Embed: LongBool): Integer; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
CMapName | PAnsiChar | A predefined CMap name (e.g. "UniGB-UCS2-H") or "Identity-H"/"Identity-V". ANSI-only — no W variant. |
Embed | BOOL32 | Accepted but not read by this call — embedding is decided later, per-call, by pdfSetCIDFont's own Embed parameter. |
Return value — 1-based CMap handle, or -1 if CMapName is empty or not a recognized predefined/Identity CMap.
See also — pdfSetCIDFont, pdfGetCMap
C# (P/Invoke)
public static extern int pdfLoadCMap(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string CMapName, [MarshalAs(UnmanagedType.Bool)] bool Embed);
Core
pdfLoadCMap
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.