PDF Editing Issues

How to Extract and Merge PDF Pages Containing a Specific Word

Chanuka GeekiyanageChanuka Geekiyanage Nov 2, 2026 869 views

Question details

The user wants to find a specific keyword across multiple PDF files, extract only the pages containing that word, and combine them into a single PDF document.

How to Extract and Merge PDF Pages Containing a Specific Word
Product
PDF Editor
Device & OS
not provided
Scenario
Managing and consolidating specific information from multiple PDF files based on a keyword search.
Observed behavior
The user needs a batch process or automated script to handle the searching, extracting, and merging workflow, as doing it manually across multiple files is inefficient.
Before you start

Gather all the PDF files you want to search into a single dedicated folder. Since this process may involve running batch automation scripts, ensure you have a backup of your original documents before proceeding.

Solution 1Recommended

Automate with Acrobat JavaScript and Action Wizard

Use the Action Wizard and custom JavaScript to create a batch process that automates searching, extracting, and merging.

Because this is a highly specific workflow, it cannot be completed with standard click-through menus in a single step. It requires custom Acrobat JavaScript or finding a pre-built Action script.

If you are new to Acrobat JavaScript, it is recommended to test your batch process on a small subset of files first to ensure it extracts the correct pages.

1
Open the Action Wizard

In your advanced PDF editor, navigate to the 'Tools' menu and select the 'Action Wizard' to start building a batch process.

2
Create or Import an Action

Click 'New Action' to write your custom extraction script, or import a pre-written batch script downloaded from community resources like the Acrobat Actions Exchange.

3
Execute the Batch Process

Add the folder containing your target PDFs to the Action. Run the Action to execute the search and extract the pages to a designated folder.

4
Merge the Extracted Pages

Once the script has finished extracting the individual pages, use the 'Combine Files' tool to select all the newly created PDFs and merge them into one final document.

Automate with Acrobat JavaScript and Action Wizard
Steep Learning Curve: Writing custom JavaScript for PDF automation can be complex. If you do not have programming experience, consider looking for community-provided scripts on official forums rather than writing the code from scratch.
Easy PDF Management

Extract and Merge PDF Pages Easily with WPS Office

While full automation requires complex scripting, WPS Office provides an intuitive and highly efficient PDF editor that makes searching text, extracting specific pages, and merging documents straightforward and accessible for all users without any coding knowledge.

  1. 1. Open and Search: Open your PDF document in WPS Office. Use the search tool (Ctrl+F) to quickly locate the exact pages containing your target word.
  2. 2. Extract Target Pages: Navigate to the 'Page' tab on the top ribbon and click on 'Extract Pages'. Enter the specific page ranges you identified and save the new file.
  3. 3. Merge Multiple PDFs: Go to the 'Tools' tab and select 'Merge PDF'. Add all the newly extracted PDF files to the list and click 'Merge' to combine them into your final document.
Easily search text within multiple PDF documentsExtract specific pages with just a few clicksCombine multiple PDFs into a single file quicklyFully compatible with standard Adobe PDF formatsCross-platform support for Windows, Mac, and mobile devices
microsoft office alternative - wps office

Frequently Asked Questions

Can I automate PDF page extraction without programming knowledge?

Fully automating text-based page extraction across multiple files generally requires scripting (such as Acrobat JavaScript). Without programming knowledge, you can use pre-built Actions downloaded from trusted community exchanges, or perform the extraction manually using a standard PDF editor.

Is there a way to search for a word across multiple PDFs at once?

Yes, many advanced PDF editors offer an 'Advanced Search' feature (often accessed via Shift+Ctrl+F). This allows you to select a specific folder on your computer and search for a keyword across all PDF files contained within it.

How do I merge the extracted pages into one PDF?

Once you have extracted and saved the individual pages as separate PDF files, you can use the 'Merge PDF' or 'Combine Files' tool found in editors like WPS Office or Adobe Acrobat to select those files and join them together into a single document.

Why use Action Scripts for this PDF task?

Action Scripts allow you to string together multiple commands—such as searching text, extracting pages, and saving the output—into a single batch process. This saves significant time and effort when dealing with a large number of PDF files.