API referenceFonts

pdfGetCMap

Read metadata for the Index-th currently-active CMap

CategoryCID/CJK fonts

Purpose — Read metadata for the Index-th currently-active CMap (loaded via pdfLoadCMap and actually in use by a CID font).

Description — For Identity-H/Identity-V, synthesizes fixed metadata (Registry="Adobe", Ordering="Identity", WritingMode from H/V). For a real predefined CMap, prefers metadata parsed from the CID font that actually uses it. Respects the caller-supplied CMap.StructSize on input — copies only that many bytes out, so a caller using an older/shorter version of the TPDFCMap struct is safe from a buffer overrun (values < 8 or larger than the full struct size are clamped to the full struct size).

Declarations

C
BOOL32 __stdcall pdfGetCMap(PPDF IPDF, uint32_t Index, TPDFCMap* CMap);
Delphi
function pdfGetCMap(const IPDF: PPDF; Index: Cardinal; var CMap: TPDFCMap): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
IndexCardinalZero-based index into the active-CMap list (not necessarily the same numbering as the handle returned by pdfLoadCMap — this enumerates *active* CMaps, i.e. ones actually referenced by a CID font).
CMapTPDFCMap*Receives the metadata; on input, CMap.StructSize bounds how many bytes are written back.

Return valueTRUE if Index is in range; FALSE otherwise.

See alsopdfGetCMapCount

C# (P/Invoke)

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

Getters

Exported names

pdfGetCMap

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.