PDF Editing Issues

How to Extract Highlighted PDF Pages to a New Document

Elise WilliamsElise Williams Nov 2, 2026 869 views

Question details

The user wants to know how to use an Acrobat JavaScript toolbar button to automatically extract pages containing highlights and annotations into a new backup PDF document.

How to Extract Highlighted PDF Pages to a New Document
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating a summary or backup document by isolating only the annotated pages from a larger PDF file.
Observed behavior
The user is seeking clarification on how a specific JavaScript extracts pages with highlights and what to do if the output does not match expectations.
Before you start

Before running any custom JavaScript in your PDF editor, verify the source of your script and save a backup copy of your original document to prevent unintended data loss.

Solution 1Recommended

Use a Custom JavaScript Action in Adobe Acrobat

Execute a custom script to automatically identify and extract pages containing highlights into a new file.

Adobe Acrobat allows users to create custom toolbar buttons that run JavaScript. A script designed to extract annotated pages typically scans the document for highlight objects, logs their page numbers, and copies those specific pages into a newly generated document object.

1
Open Action Wizard

Navigate to 'Tools' and select 'Action Wizard'. Click on 'New Custom Command' from the toolbar.

2
Input the Custom Script

Select 'Execute JavaScript', click on 'Options', and paste your specific extraction and embedded icon code into the text editor.

3
Execute the Command

Save the command to add it to your toolbar. Open your target PDF and click the newly created button to run the script and generate your backup document containing only the highlighted pages.

Use a Custom JavaScript Action in Adobe Acrobat
Troubleshooting Script Errors: If the script does not produce the expected output, press Ctrl+J (Cmd+J on Mac) to open the JavaScript Debugger console and check for syntax errors or execution warnings.
Easy PDF Page Extraction

Extract PDF Pages Effortlessly with WPS Office

Skip complex JavaScript coding and troubleshooting. WPS PDF provides an intuitive, built-in graphical tool to split, extract, and organize specific pages from your documents in just a few clicks.

  1. 1. Open the PDF File: Launch WPS Office and open the PDF document containing your highlights.
  2. 2. Navigate to the Page Tool: Click on the 'Page' tab located on the top navigation ribbon.
  3. 3. Set Up Extraction: Click on 'Extract Page'. A dialog box will appear allowing you to select 'Custom extraction'.
  4. 4. Extract and Save: Enter the specific page numbers that contain your highlights, then click 'Extract' to instantly create and save your new backup document.
No coding or JavaScript execution requiredVisually select and extract pages instantlyFully compatible with standard Adobe PDF formatsLightweight, fast, and feature-rich PDF editor
microsoft office alternative - wps office

Frequently Asked Questions

Why is my Acrobat JavaScript button not working?

JavaScript execution might be disabled due to security settings. Go to Edit > Preferences > JavaScript and ensure the 'Enable Acrobat JavaScript' option is checked. Also, verify that the script syntax is correct for your specific software version.

Can I extract just the highlighted text instead of the entire page?

Yes. Most advanced PDF editors have a 'Summarize Comments' or 'Export Comments' feature. This allows you to generate a new PDF or text file that lists only the highlighted text and annotations, rather than copying the full page layouts.

Is it possible to automate PDF page extraction without programming?

Yes, modern PDF tools like WPS PDF offer built-in graphical interfaces to split and extract pages natively, completely removing the need for custom JavaScript codes or complex commands.