Customizing the Page Number


PSPDFKit supports the PDF Page Label feature, which means you can rewrite and change the regular absolut 1-based numbering in PDF documents.

This means, that a document that usually has the page numbering 1, 2, 3, 4 can be changed to have numbers like Prelude, Table Of Contents, 1, 2. Page labels can be numbers, roman numbers or even free-text strings.

PSPDFKit fully supports page labels and will show these custom labels instead of the default numbering when available in all places where page labels are displayed. This includes the Table of Contents view controller, the page position view and the thumbnail views.

You can configure page labels via Adobe Acrobat via opening the thumbnail view, right clicking on a page and choosing the "Number Pages..." menu entry.

Editing Page Labels in Code

It's also possible to define and edit page labels in code. The PSPDFLabelParser will parse the label definition data from the PDF. Starting with PSPDFKit v4, you can create a custom label parser class using the initWithDocumentProvider:labels: initializer, and setting this custom interface to the PSPDFDocumentProvider.

Was this page helpful? We're happy to answer any questions.