How to Find Pages Containing a Specific Word and Split a PDF
Question details
The user wants to identify pages within a large PDF manuscript that contain a specific word, such as "introduction", and split the document at those pages without manually creating bookmarks.

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Managing and organizing a large collection of merged manuscripts that need to be divided based on chapter headings or specific keywords.
- Observed behavior
- The user needs an automated or script-based workflow to locate text strings and extract or split pages, rather than relying on the manual insertion of document bookmarks.
Ensure your PDF documents are text-searchable. If they consist of scanned images, you must perform OCR (Optical Character Recognition) before any script or search tool can recognize the specific words.
Use Custom JavaScript in Adobe Acrobat to Split by Word
Run a customized Acrobat JavaScript to systematically search each page for the target word, record matching page numbers, and programmatically split the document.
Acrobat JavaScript allows for deep document manipulation. A custom script can iterate through a PDF using the getPageNthWord method to locate your target string (e.g., "introduction"). Once a match is found, the script can utilize the extractPages function to split the document at those exact locations.
Note that this requires a desktop application capable of running PDF JavaScript, such as Adobe Acrobat Pro, and the script must account for case variations, text formatting, and the structure of the source documents.
Launch your advanced PDF editor (like Acrobat Pro), open your manuscript, and navigate to 'Tools' > 'JavaScript' > 'Document JavaScripts' or open the JavaScript Debugger console.
Write or paste a custom script that loops through numPages. Use a loop with getPageNumWords and getPageNthWord to evaluate text against your specific word. Store the matching page numbers in an array.
Add commands to your script using the extractPages method, specifying the start and end values based on the matched page array. Run the script to generate the split PDF files.

Manually Search and Extract Pages
If custom scripting is too complex, use the built-in search functionality combined with the page extraction tool to divide the document.
Easily Search, Edit, and Split PDFs with WPS Office
While custom scripting requires programming expertise, WPS Office provides an intuitive, user-friendly interface to quickly search through large manuscripts, extract pages, and split PDF documents into separate files without writing any code. It also includes built-in OCR for scanned documents.
- 1. Open Your PDF in WPS Office: Launch WPS Office and open your large manuscript. If it is a scanned document, navigate to 'Tools' and run 'OCR' to make the text searchable.
- 2. Find the Target Word: Press 'Ctrl + F' to open the Find dialog. Search for your specific word and note the page numbers where the document needs to be divided.
- 3. Access the Split PDF Tool: Go to the 'Page' tab on the top ribbon and select the 'Split PDF' option.
- 4. Set Page Ranges and Split: Choose 'Custom splitting' and input the page numbers you identified. Click the 'Split' button to instantly save the separated manuscripts.

Frequently Asked Questions
Can I automatically split a PDF by bookmarks?
Yes, many PDF editors, including WPS PDF and Adobe Acrobat, feature a built-in option to split documents directly based on top-level bookmarks. This avoids the need for complex scripts if the document is already bookmarked.
Why isn't my search finding the specific word in the PDF?
If your search returns no results, the document is likely a scanned image rather than a text-based PDF. You must first apply Optical Character Recognition (OCR) to convert the image pixels into readable, searchable text.
Are there online tools that split PDFs by searching for specific words?
Most online PDF splitters can only divide files by page number, file size, or predefined bookmarks. Splitting a document programmatically based on a specific text string typically requires advanced desktop software or custom scripting.




