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.

Page Labels Visibility

You can disable/enable page labels through PdfActivityConfiguration by calling hidePageLabels()/showPageLabels() in the PdfActivityConfiguration.Builder. Page labels are displayed by default (if there are any, if not - regular page numbers are displayed instead).

Example:

1
2
3
val config = PdfActivityConfiguration.Builder(context)
    .showPageLabels()
    .build()
1
2
3
final PdfActivityConfiguration config = new PdfActivityConfiguration.Builder(context)
    .showPageLabels()
    .build();