API referenceCore SDK

pdfGetPageLabel

Read/clear the document's /PageLabels number-tree ranges

C
BOOL32 __stdcall pdfGetPageLabel(PPDF IPDF, uint32_t Index, TPDFPageLabel* Lbl);
int32_t __stdcall pdfGetPageLabelCount(PPDF IPDF);
void __stdcall pdfDeletePageLabels(PPDF IPDF);
Delphi
function pdfGetPageLabel(const IPDF: PPDF; Index: Cardinal; var Lbl: TPDFPageLabel): LongBool; stdcall;
function pdfGetPageLabelCount(const IPDF: PPDF): Integer; stdcall;
procedure pdfDeletePageLabels(const IPDF: PPDF); stdcall;

Purpose. Read/clear the document's /PageLabels number-tree ranges (custom page-numbering schemes, e.g. roman-numeral front matter followed by arabic body pages).

Description. pdfGetPageLabel's output Lbl.PrefixUni is always False — the prefix string is only ever exposed as an ANSI PAnsiChar (Lbl.Prefix), with its length manually walked to the null terminator to fill Lbl.PrefixLen; there is no wide-prefix output path despite the PrefixUni flag's presence implying one might exist.

Parameters.

ParameterDescription
IPDFDocument handle.
Index*(GetPageLabel only)* 0-based index into the label-range list.
LblOutput: StartRange, Format, FirstPageNum, Prefix/PrefixLen (ANSI only — PrefixUni always False).

Return value. pdfGetPageLabel: True if Index is in range. pdfGetPageLabelCount: the range count; 0 if IPDF invalid. pdfDeletePageLabels: none (removes all label ranges).

C# (P/Invoke)

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

Getters

Exported names

pdfGetPageLabel

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.