How to Automatically Create PDF Bookmarks from Colored Separator Pages
Question details
The user wants to automatically create bookmarks in a scanned PDF based on the presence of colored separator pages (such as green sheets).

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Scanning large document batches using colored separator sheets to divide sections, and wanting to automate the bookmarking process for each new section.
- Observed behavior
- Adobe Acrobat scripting does not have native access to analyze page colors or raster image graphics, making direct color-based bookmark automation impossible without custom tools.
Check if your colored separator pages contain any standardized, unique text (like 'Section Break' or 'New Chapter'), as text-based bookmark generation is much easier to automate.
Use Acrobat JavaScript to Detect Unique Text Instead of Color
Since Acrobat cannot detect color via scripting, utilizing unique text printed on the separator pages is the most practical workaround for automating bookmark creation.
The Acrobat scripting model lacks access to the graphics or color profiles of a scanned raster image. However, it excels at finding words and text.
By ensuring your colored separator pages have a unique text identifier printed on them prior to scanning, you can use a JavaScript snippet to search for that text and automatically build your bookmarks.
Launch Adobe Acrobat and open the scanned PDF document containing your separator pages.
Go to the 'Scan & OCR' tool and recognize the text in the document so that the unique text on the separator pages becomes searchable.
Navigate to Tools > Action Wizard or use the JavaScript Debugger console to input a custom script.
Write and run a script that loops through the document's pages (numPages), searches for the unique separator string (using getPageNumWords and getPageNthWord), and creates a new bookmark when the text is found.
Use an External Image-Processing Tool
Export the PDF pages as individual images and process them through a standalone color-recognition tool to identify the separator pages.
Efficiently Create and Manage PDF Bookmarks with WPS Office
While automated color-based bookmarking requires advanced external scripting, WPS Office provides an intuitive, lightweight PDF editor that allows you to rapidly navigate and manually add bookmarks to your scanned documents without complex setups.
- 1. Open your PDF in WPS Office: Launch WPS Office and open your scanned PDF document.
- 2. Open the Navigation Pane: Click the 'Bookmark' or 'Thumbnail' icon on the left-hand sidebar to view your document structure.
- 3. Locate Separator Pages: Scroll through the page thumbnails. The colored separator pages will be visually distinct and easy to spot.
- 4. Add a Bookmark: Right-click the colored page or click the '+' icon in the Bookmark pane to instantly create a new bookmark.
- 5. Organize and Rename: Type the name of the new section for your bookmark and drag it to organize your document hierarchy.

Frequently Asked Questions
Why can't Adobe Acrobat natively detect colored pages for bookmarking?
Adobe Acrobat's built-in JavaScript scripting model does not have direct access to analyze graphics, background colors, or the pixel data of raster images in scanned PDFs. It is primarily designed to interact with text, form fields, and document metadata.
Can a custom plug-in detect colored separator pages in a PDF?
Yes. While JavaScript is limited, a custom Acrobat plug-in developed using the Acrobat SDK (in C/C++) has deeper access to the page content and rendering engine, allowing it to potentially analyze raster images for specific color profiles.
What is the best alternative to color-based PDF bookmarking?
The most reliable alternative is to print unique, standardized text (e.g., 'Section Divider') on your colored separator pages before scanning. You can then run OCR and use a simple script to find that exact text and automatically generate bookmarks.




