API referenceFonts

pdfLoadCMap

Register a predefined CMap name for use with

CategoryCID/CJK fonts
NoteEmbed 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

C
int32_t __stdcall pdfLoadCMap(PPDF IPDF, const char* CMapName, BOOL32 Embed);
Delphi
function pdfLoadCMap(const IPDF: PPDF; const CMapName: PAnsiChar; Embed: LongBool): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
CMapNamePAnsiCharA predefined CMap name (e.g. "UniGB-UCS2-H") or "Identity-H"/"Identity-V". ANSI-only — no W variant.
EmbedBOOL32Accepted 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 alsopdfSetCIDFont, pdfGetCMap

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfLoadCMap(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string CMapName, [MarshalAs(UnmanagedType.Bool)] bool Embed);
Area
Fonts
Category

Core

Exported names

pdfLoadCMap

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.