PDF Editing Issues

How to Flatten Bookmarks in a Combined PDF or Portfolio

Bushra ParveenBushra Parveen Nov 3, 2026 869 views

Question details

The user needs to flatten nested bookmarks into a single, top-level list after combining multiple PDF files, so they are not grouped under individual source file names.

How to Flatten Bookmarks in a Combined PDF
Product
Adobe Acrobat / PDF Editors
Device & OS
not provided
Scenario
Combining multiple PDF documents into a single file or a PDF portfolio.
Observed behavior
Bookmarks are automatically nested under the source file names instead of forming a single flat list, which breaks automated hyperlinking and lookup functions.
Before you start

Ensure you save a backup copy of your original combined PDF before running any console scripts or third-party plugins, as bulk modifications to the bookmark tree cannot always be undone.

Solution 1Recommended

Use PDF JavaScript to Flatten Bookmarks

Since most standard PDF editors lack a native one-click flattening button, running a custom JavaScript console script is the most direct way to reorganize the bookmark tree programmatically.

This method requires using the JavaScript debugging console in Adobe Acrobat. You will need to source a flattening script (often shared in Adobe community forums) that iterates through all child bookmarks and moves them to the root level.

1
Open the JavaScript Console

In Adobe Acrobat, press Ctrl+J (on Windows) or Cmd+J (on Mac) to open the interactive JavaScript debugger console.

2
Execute a flattening script

Paste an Acrobat JavaScript snippet designed to loop through the bookmark hierarchy and move child items to the root. Highlight the code block and press Ctrl+Enter (or Enter on the numeric keypad) to execute it.

3
Save the updated PDF

Once the script finishes executing and you verify that the bookmarks now appear at the top level in the side panel, save your document to apply the changes.

Use PDF JavaScript to Flatten Bookmarks
Script Availability: If you do not know how to write the script, search the official Adobe community forums for 'Flatten Bookmarks JavaScript' to find pre-written code snippets shared by experts.
Manage PDFs Easily

Combine and Manage PDF Bookmarks with WPS Office

WPS Office provides a powerful, intuitive PDF editor that makes combining files and managing bookmarks simple. Instead of relying on complex JavaScripts, you can easily drag, drop, and reorganize bookmarks manually, or cleanly combine PDFs from the start.

  1. 1. Open WPS Office: Launch WPS Office and open your combined PDF document using the WPS PDF tool.
  2. 2. Access the Bookmark Panel: Click on the Bookmark icon on the left-hand navigation pane to reveal the document's current bookmark hierarchy.
  3. 3. Reorganize Bookmarks: Click and drag nested bookmarks to the desired root level to manually flatten them, or manage them using the right-click menu options.
Easily add, delete, and reorganize PDF bookmarks in a visual side panel.Seamlessly combine multiple PDFs, Word documents, and images into a single file.Highly compatible with Adobe Acrobat PDF standards and formatting.Lightweight, fast, and includes a comprehensive suite of PDF editing tools.
microsoft office alternative - wps office

Frequently Asked Questions

Why do bookmarks nest when combining PDFs?

When combining multiple files, standard PDF editors automatically group the bookmarks under the original file's name by default. This is done to maintain the structure of the individual source documents and avoid bookmark naming conflicts.

Can I manually drag bookmarks out of nested folders?

Yes. In most PDF editors, including Adobe Acrobat and WPS PDF, you can open the bookmark panel, select the child bookmarks, and drag them to the root level. However, this manual method can be time-consuming for large documents with hundreds of bookmarks.

Will flattening bookmarks break my hyperlinks?

Moving a bookmark to a new level in the hierarchy does not typically break its destination link. The bookmark will still point to the exact same page, zoom level, or view destination in the combined document.