PDF Editing Issues

How to Export Acrobat Bookmark Names and Page Numbers to a New Document

Algirdas JasaitisAlgirdas Jasaitis Nov 10, 2026 869 views

Question details

The user wants to recursively extract bookmark names and their corresponding page numbers from a PDF file using Acrobat JavaScript and output them into a new document.

How to Export Acrobat Bookmark Names and Page Numbers to a New Document
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Generating a report or a table of contents by extracting existing PDF bookmark data to a separate file.
Observed behavior
Requires a decision on the final output format (e.g., plain text, form field contents, or a separate static PDF) before executing the JavaScript extraction.
Before you start

Determine your desired final output format (such as a simple text string in the JavaScript console, a CSV format, or a brand new static PDF document) before writing your extraction script.

Solution 1Recommended

Extract Bookmarks Using Acrobat JavaScript Console

Use a custom JavaScript in the Adobe Acrobat Debugger Console to traverse the bookmark tree and print the names and page numbers.

Acrobat JavaScript provides the ability to recursively inspect the bookmark tree using the bookmarkRoot object.

Because retrieving exact page numbers natively via bookmark properties can be complex, scripts typically read the destination page and output it as text.

1
Open the JavaScript Debugger

Open your PDF in Adobe Acrobat. Press Ctrl + J (Windows) or Cmd + J (Mac) to open the JavaScript Debugger.

2
Write the Extraction Function

In the Console window, write a recursive JavaScript function that iterates over this.bookmarkRoot.children. Extract the 'name' property of each child.

3
Retrieve Page Numbers

Within your script, use the bookmark's action to evaluate the destination page. Push the bookmark name and page number into an array as a formatted string.

4
Output to Console

Use console.println() to print the final array. You can then copy this plain text output and paste it into a new Word document, Excel spreadsheet, or text file.

Extract Bookmarks Using Acrobat JavaScript Console
Scripting Requirement: This method requires basic knowledge of Acrobat JavaScript. If the bookmark destination is complex (e.g., named destinations), retrieving the page number programmatically may require additional script logic.
Free Microsoft Office alternative

Manage PDF Documents Efficiently with WPS Office

While running complex JavaScript extractions requires Adobe Acrobat, WPS Office offers a free, lightweight, and incredibly intuitive alternative for managing, reading, and editing PDFs. Enjoy a seamless user interface to handle standard PDF tasks without the heavy system requirements.

  1. 1. Download and Install WPS Office: Visit the official WPS website to download the free suite and follow the quick installation instructions.
  2. 2. Open Your PDF: Launch WPS PDF and open your document directly within the application.
  3. 3. Navigate via Bookmarks: Click the Bookmark icon on the left-hand navigation pane to instantly view, rename, or reorganize your document's outline.
Intuitive sidebar panel for easy navigation and management of PDF bookmarks.Fully compatible with standard PDF files, as well as Microsoft Office formats like Word, Excel, and PowerPoint.Lightweight design that runs smoothly on almost any device without consuming massive system resources.Includes a comprehensive suite of editing, converting, and commenting tools for everyday PDF workflows.
microsoft office alternative - wps office

Frequently Asked Questions

Can I export PDF bookmarks directly to an Excel file?

Adobe Acrobat does not have a native, one-click button to export bookmarks directly to Excel. You must either use a custom JavaScript to format the output as comma-separated values (CSV) or use a third-party plugin to generate a file that Excel can open.

Why is it difficult to get the exact page number via Acrobat JavaScript?

Bookmarks in PDFs don't always point to a specific page index; they often point to 'Named Destinations' or execute specific actions (like running a menu item). A script must correctly evaluate these destinations to calculate the physical page number, which requires slightly more complex coding.

Is it possible to print just the bookmark list from a PDF?

By default, printing a PDF prints its page content. To print a list of bookmarks, you first need to extract them into a new document (using a JavaScript report or a plugin) and then print that newly generated document.