๐ท๏ธ Page Labels
Custom page numbering: Roman numerals for front matter, decimal for body, prefixed for appendices.
C# โ Page Labels
// Front matter: lowercase Roman (i, ii, iii)
doc.AddPageLabels(0,
PdfPageLabelStyle.LowercaseRoman);
// Body: decimal starting at 1 (1, 2, 3...)
doc.AddPageLabels(2,
PdfPageLabelStyle.Decimal);
// Appendix: prefixed (A-1, A-2...)
doc.AddPageLabels(4,
PdfPageLabelStyle.Decimal, "A-", 1);
You should see five pages. Check the page-number indicator in your PDF viewer's toolbar โ it should read i, ii, 1, 2, and A-1 as you flip through. Each page displays its label name as a heading (e.g. "Cover (page i)") and a reminder to check the viewer's navigation panel.
File: 10_page_labels.pdf
Available Styles
| Style | Output | Common Use |
|---|---|---|
Decimal | 1, 2, 3, 4โฆ | Body pages |
LowercaseRoman | i, ii, iii, ivโฆ | Front matter |
UppercaseRoman | I, II, III, IVโฆ | Front matter |
LowercaseLetters | a, b, c, dโฆ | Sub-sections |
UppercaseLetters | A, B, C, Dโฆ | Appendices |