THotPDF.SetPageLabel Method
Adds or replaces a generated-document page-label range that starts at a zero-based page index
Declaration
procedure SetPageLabel(StartPageIndex: Integer; Style: THPDFPageLabelStyle; const Prefix: AnsiString = ''; StartNumber: Integer = 1);
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
StartPageIndex | Zero-based page index where the label range begins |
Style | Numbering style from THPDFPageLabelStyle |
Prefix | Optional text placed before each generated page number |
StartNumber | First logical number used by this range, starting at 1 or higher |
Usage notes
- The method writes a catalog
/PageLabelsnumber tree whenEndDocfinalizes the generated PDF - Calling the method again with the same
StartPageIndexreplaces the earlier range - When no range starts at the first page, the pages before the first range keep plain decimal numbers, because the number tree must cover page index 0 (ISO 32000-1 12.4.2)
- A prefix with bytes above 127 is read as UTF-8 and stored as a Unicode text string
- The active PDF version must support page labels, so HotPDF raises or validates PDF 1.3 according to
StrictVersionLock - Page labels change viewer page-number display and do not reorder pages