◆ Acrobat · organize

Programmatically renumber page labels using Acrobat JavaScri

A project report needs a header with the client name '[client=Greenfield Energy]' and a footer with page numbering 'Pa…

3ready prompts
1real task

When to use it

real situations

AI prompts

3 ways to ask · copy any one
AExecute — “help me do it”Write JavaScript to renumber all PDF page labels to...…+
Write Acrobat JavaScript code to renumber all PDF page labels to [your desired format, e.g., 1, 2, 3...] using the Adobe PDF Services API.
when the reply comes backNeed help with authentication for the API?
BImprove — “do it better”Suggest improvements so the code can handle different...…+
Suggest improvements so the Acrobat JavaScript code for renumbering PDF page labels can handle different numbering styles or sections automatically.
when the reply comes backWant to batch process multiple PDFs at once?
CDecide — “help me choose”List and compare common page label formats (like...…+
List and compare common page label formats (like Roman numerals, letters, or custom text) for PDFs, and help me choose the best one for [my use case].
when the reply comes backCurious how to undo label changes programmatically?

How to do it

the tool · the steps · what to avoid
  1. 1

    Open the PDF file you want to renumber in Adobe Acrobat Pro.

  2. 2

    Press Ctrl+J (Windows) or Cmd+J (Mac) to open the JavaScript Console.

    Best practiceYou can also access the JavaScript Console via the Tools > JavaScript > Debugger menu if enabled.

  3. 3

    In the Console, enter a JavaScript script that uses the setPageLabels() method to define new page labels for your document.

    RecommendationRefer to the Acrobat JavaScript API Reference for the correct syntax of setPageLabels().

  4. 4

    Run the script by pressing Ctrl+Enter (Windows) or Cmd+Enter (Mac) in the Console.

  5. 5

    Review the document to confirm that the page labels have been updated as intended.

    Best practiceIf you need to apply complex labeling patterns (e.g., Roman numerals for front matter, Arabic for main content), structure your setPageLabels() array accordingly.

  6. 6

    Save the PDF to preserve the new page labels.

You can use the JavaScript Console in Acrobat Pro to quickly apply custom page label schemes across large documents.

This runs in the Acrobat app - there is no separate API for this task.

Glossary

words on this page
Page LabelA name or number shown for each page in a PDF.ExampleThe page label for the first page of the appendix might be 'Appendix A-1'.
APIA way for different software to talk to each other automatically.ExampleAn online store uses an API to automatically send shipping details to a delivery service.
JavaScriptA coding language used to automate tasks in PDFs and web pages.ExampleJavaScript can make a PDF form automatically calculate a total when you enter numbers.

The real tasks

the one, listed here
Add headers and footers to pdfs

FAQ

about this task

You can send your PDF to the Adobe PDF Services API and use JavaScript code to set new page labels. This lets you automate numbering, so each page shows the label you want, like 1, 2, 3 or custom text.

A page label is the number or name shown for each page in a PDF file. It helps users find pages easily, especially when the document has sections that need different numbering styles.

Yes, you can use JavaScript to assign different label styles to different page ranges, such as Roman numerals for the intro and numbers for the main content, by specifying the format for each section in your code.

Renumbering with code is much faster and more consistent, especially for large or multiple PDFs. Manual editing is slower and can lead to mistakes if you have many pages or complex formats.

Automating page labels lets you match document standards, make navigation easier, and handle special cases like appendices or combined files, which is hard to do with default numbering.

Sources

where this comes from
Copyright © LLOS.ai · 2026 — original pedagogy, voice, and design — all rights reserved.
Built on public evidence: O*NET®, ESCO, Wikipedia, U.S. Bureau of Labor Statistics, forum demand signals.