Other PDF Issues

How to Change PDF Page Number Format to "1 OF n"

Natalie TaylorNatalie Taylor Nov 5, 2026 869 views

Question details

The user wants to format PDF page numbers to display an uppercase "OF" (e.g., "1 OF 10") instead of the application's default lowercase "1 of n" format.

How to Change PDF Page Number Text to “1 OF n”
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Adding or modifying page numbers in a PDF document to adhere to a specific stylistic or corporate branding requirement.
Observed behavior
The built-in page numbering macro only provides a lowercase "of" option, lacking a native dropdown selection for an uppercase "OF".
Before you start

Verify that your PDF editing software supports JavaScript execution or custom text fields in Headers and Footers, as standard PDF readers lack the ability to alter page number macros.

Solution 1Recommended

Use a Custom JavaScript to Format Page Numbers

Because the built-in macro does not support uppercase "OF", running a custom JavaScript is the most efficient way to automate the "1 OF n" format across all pages.

Advanced PDF editors allow users to execute document-level JavaScripts. By running a simple loop script, you can generate custom text fields on every page that dynamically pull the current page number and the total page count, separated by an uppercase "OF".

1
Open the JavaScript Console

In your PDF editor (such as Acrobat Pro), navigate to the Tools menu, find the JavaScript section, and open the Document JavaScripts or Debugger console.

2
Input the Custom Script

Enter a script that loops through 'this.numPages'. The script should use the 'addField' method to place a text box on each page containing the string: (i + 1) + " OF " + this.numPages.

3
Execute the Script

Run the script to automatically stamp the custom page number format in the designated coordinates on every page of your PDF document.

Use a Custom JavaScript to Format Page Numbers
Scripting Knowledge Required: Writing and executing JavaScript requires basic programming familiarity. If you are unsure of the exact coordinates for the page number, test the script on a single page first.
Easy PDF Page Numbering

Customize PDF Page Numbers Effortlessly with WPS Office

Skip complex scripting methods. WPS Office provides an intuitive PDF editor that makes it incredibly easy to insert, format, and customize headers, footers, and page numbers to match your exact document requirements.

  1. 1. Open the PDF File: Launch WPS Office and open your target PDF document.
  2. 2. Navigate to Header and Footer: Click on the 'Edit' tab at the top of the interface, select 'Header and Footer', and choose 'Add Header and Footer'.
  3. 3. Customize Your Text: In the dialog box, use the text fields to combine text and page macros to achieve your desired format, adjusting the font and layout as needed.
  4. 4. Apply and Save: Click 'OK' to apply the formatting to your selected page range, then save your updated document.
Intuitive Header and Footer customization toolsFully compatible with all standard PDF formats and Adobe filesEasily adjust fonts, alignment, and page rangesLightweight, fast, and feature-rich PDF editing experience
microsoft office alternative - wps office

Frequently Asked Questions

Can I change the font style and size of PDF page numbers?

Yes. When adding page numbers through the Header & Footer dialog in your PDF editor, you can select the text and adjust the font type, size, color, and alignment before applying it to the document.

Why can't I edit existing page numbers in my PDF?

Existing page numbers might be flattened into the document's background or embedded as image elements rather than text. You may need to use an OCR (Optical Character Recognition) tool or manually crop them out before adding new page numbers.

Is it possible to start page numbering from page 2 or 3?

Yes. Most advanced PDF editors feature 'Page Range Options' within the Header and Footer settings. You can specify exactly which pages should receive the numbering, effectively skipping the cover or table of contents pages.

Does WPS PDF support Bates numbering for legal documents?

Yes, WPS PDF provides Bates numbering features designed for legal and professional documents, allowing you to add unique prefixes, suffixes, and sequential numbers across multiple PDF files simultaneously.