PDF Page Labels Editor
Operator: Abdulla Al Fahad. How tools are built and checked
A thesis PDF whose title sheet and front matter take twelve pages, and whose chapter one is printed page 1, shows as page 13 of 214 in the viewer, so a reader who types the printed number from the index lands twelve pages off. PDF page labels fix that: the file records that pages 1 to 12 are numbered i to xii and that arabic numbering starts again at page 13, and viewers that honour labels, such as Acrobat and Firefox's built-in reader, show the printed numbers in their page box.
Key features
- Reads the labels a file already has and shows them as editable ranges
- Five numbering styles plus a prefix-only style, a prefix of your own and a start number per range
- Presets for roman front matter followed by arabic, a prefixed appendix, and plain numbering
- A preview of every page's label, with warnings for repeated labels and roman numerals past 3999
- A button that removes the labels entirely
- Saves a copy; page content is copied exactly as it is
How a label range is defined
Labels live in the catalog under /PageLabels as a number tree: pairs of a page index, counted from 0, and a label dictionary. A dictionary can hold /S, the style (D decimal, R upper roman, r lower roman, A upper letters, a lower letters), /P, a prefix, and /St, the number the range starts at, which defaults to 1 and cannot be lower. A range runs until the next entry. The specification requires an entry for page index 0, so when a file lacks one this tool shows page 1 as plain decimal and writes the entry on save.
Roman numerals are written for 1 to 3999, and past that the tool shows plain digits and warns. The letter styles are not base 26: pages run A to Z, then AA to ZZ, then AAA to ZZZ, so number 27 is AA, number 28 is BB and number 53 is AAA. A range with the style "no number" gives every page just the prefix, which suits unnumbered pages such as a cover.
Reading walks the tree through /Kids nodes and /Nums arrays up to 16 levels deep and 20,000 entries, and notes any entry that points outside the file. Saving always writes one flat /Nums array in range order and removes any nested tree. A prefix with characters beyond printable ASCII is stored as a UTF-16 hex string. The tool handles up to 5,000 pages and 200 ranges.
How it works
The file is opened with the same loader the other PDF page tools use, so a PDF that has only printing or copying restrictions opens, and saving drops those restrictions with a notice.
Your ranges are normalised before use: sorted by start page, a later range replaces an earlier one that starts on the same page, start pages are kept inside the document, and a first range at page 1 is added if missing.
The preview and the saved file come from the same function, so the list you check is the list that is written.
Nothing on the pages changes. Labels alter only the number a viewer displays in its page box, thumbnails and go-to dialog; any number printed on the page stays exactly as drawn.
Common use cases
- A 214-page thesis: roman numerals for the first 12 pages, then arabic from 1, so the viewer's page box matches the printed 1 to 202.
- A 90-page book with a prefixed appendix starting at page 78: the last 13 pages read A-1 to A-13 while the body keeps plain numbers.
- A chapter cut out of a 400-page book that starts on printed page 147: one range with decimal numbering and first number 147 keeps the original page numbers.
How to use this tool
- Drop the PDF; existing labels appear as ranges, or a note says there are none.
- Press a preset or edit the ranges: start page, numbering style, prefix and first number.
- Read the preview and any warnings.
- Save the PDF, or use Remove labels to take them out.
Example
A 14-page file and three ranges
Range 1: from page 1, lower roman, no prefix, first number 1
Range 2: from page 4, decimal, no prefix, first number 1
Range 3: from page 12, decimal, prefix A-, first number 1Labels for pages 1 to 14
i, ii, iii, 1, 2, 3, 4, 5, 6, 7, 8, A-1, A-2, A-3
Opening the saved file in the browser's PDF reader shows the same 14 labels.Tips for best results
- Presets replace the whole range list, so apply one first and edit afterwards rather than the other way round.
- Use "no number (prefix only)" for a cover or plates. Every page of that range gets the same label, so the repeated-label warning is expected there.
- To restart at 1 in the middle of a document, add a range at that page with first number 1 and a prefix, or the go-to box will find only the earlier 1.
- A first number above 1 suits extracts: a chapter taken from a printed book can keep its own page numbers.
- To check a label by hand, type it into the page box of Acrobat or Firefox: iv jumps to the fourth page of a roman range.
Common pitfalls
Not every program reads labels. Some print dialogs and older viewers show only the physical position, so a label is a convenience for readers, not a replacement for printed numbers.
Adding or deleting pages later in another tool moves the physical positions, and many tools do not update /PageLabels, so the ranges stop lining up. Reopen the file here and check.
Common errors and how to fix them
- The preview warns that pages 4 and 12 would both be labelled "1", after a restart at page 12 with no prefix
- Labels need not be unique, but a viewer's go-to box finds only the first. Give the later range a prefix such as A- or a different first number.
Best practices
- Take start numbers from the numbers printed on the pages, not from their position: find the first body page, read the number on it, and enter that as the first number.
- Give every range its own style and prefix: a range inherits nothing from the one before it, so a range that restarts at 1 still needs its own decimal style.
Labels and printed page numbers are different things
Add Page Numbers to PDF here draws numbers onto the pages. Labels draw nothing; they only change the number a viewer reports for a page. When a document has no printed numbers and you want the viewer to agree with the ones you stamp, use both, with the same style and start number in each.