How to Extract and Merge PDF Pages Containing a Specific Word
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.

- 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.
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.
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.
In your advanced PDF editor, navigate to the 'Tools' menu and select the 'Action Wizard' to start building a batch process.
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.
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.
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.

Manually Search, Extract, and Merge Pages
If you do not have access to scripting tools, you can perform the task manually for a smaller number of PDF files.
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. 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. 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. 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.

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.




