PDF Editing Issues

How to Fix PDF Splitting Errors Caused by Duplicate Bookmark Names

Phi Hung VoPhi Hung Vo Nov 5, 2026 869 views

Question details

The user is unable to successfully split a PDF document by its top-level bookmarks because multiple bookmarks share identical names, resulting in file overwrites or failed split operations.

How to Split PDFs When Top-Level Bookmarks Have Duplicate Names
Product
PDF Editor
Device & OS
Windows
Scenario
Attempting to extract sections of a large PDF into individual files automatically named after the document's top-level bookmarks.
Observed behavior
The PDF splitting process overwrites existing files because the application tries to save multiple files with the exact same name, as Windows does not automatically append numbers to programmatically generated duplicate filenames.
Before you start

Before attempting to split your PDF, expand the bookmark navigation pane to visually scan for any identically named top-level bookmarks.

Solution 1Recommended

Use Custom JavaScript to Auto-Rename Duplicate Bookmarks

Execute a custom script within your advanced PDF editor to automatically detect identical bookmark names and append unique alphanumeric suffixes.

When an application splits a PDF by bookmarks, it relies on the bookmark names to generate filenames. Because the Windows operating system does not automatically append unique numbers when a program saves duplicate filenames, the application will simply overwrite the earlier file. To prevent this, every top-level bookmark must be unique before initiating the split.

1
Open the JavaScript Debugger

Launch your PDF application (such as Adobe Acrobat), navigate to the Tools menu, and open the JavaScript Debugger or Console.

2
Run the Renaming Script

Enter a custom JavaScript function designed to iterate through the top-level bookmark tree. The script should identify duplicate strings and append a unique identifier (e.g., adding '_1', '_2') to each identical bookmark name.

3
Execute the PDF Split

Once the script finishes renaming the bookmarks, go to the document extraction settings and select 'Split by Top-Level Bookmarks'. The application will now generate distinct, non-overlapping files.

Use Custom JavaScript to Auto-Rename Duplicate Bookmarks
Scripting Knowledge Required: This method requires a pre-written custom JavaScript tailored for your specific PDF editor's API. If you are not familiar with scripting, consider the manual renaming method.
Efficient PDF Editor

Manage Bookmarks and Split PDFs Easily with WPS Office

WPS Office offers a comprehensive, easy-to-use PDF editor that allows you to intuitively manage bookmarks, rename duplicates visually, and split PDFs without relying on complex scripts.

  1. 1. Open the PDF in WPS Office: Launch WPS Office on your computer and open the PDF document you wish to split.
  2. 2. Modify Duplicate Bookmarks: Click the Bookmark icon on the left navigation pane. Right-click any duplicate bookmarks and rename them so every top-level title is unique.
  3. 3. Use the Split PDF Feature: Navigate to the 'Page' tab on the top ribbon and select 'Split PDF'. Choose your preferred extraction method to safely divide your document into separate files.
Intuitive sidebar for quick visual editing and renaming of PDF bookmarks.Built-in 'Split PDF' tool to easily separate large documents into manageable files.High format compatibility with standard Adobe PDF files and Microsoft Office documents.Lightweight desktop application that is fast and free to download.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my PDF editor overwrite files when splitting by bookmarks?

When splitting a PDF, the software uses the top-level bookmark names as the new filenames. If multiple bookmarks have the same name, the software attempts to save multiple files with identical names. Depending on its save behavior and permissions, it will continually overwrite the existing file instead of creating a new one.

Doesn't Windows automatically add numbers like (1), (2) to duplicate files?

Windows automatically appends numbers when a user manually copies and pastes a file with an identical name in File Explorer. However, when an application programmatically creates and saves files during a batch process like PDF splitting, the operating system does not automatically intervene to rename them.

Do I need to rename nested sub-bookmarks as well?

If you are only splitting the document by top-level bookmarks, you only need to ensure the top-level bookmark names are unique. The names of nested sub-bookmarks will not affect the file naming process during the split.