PDF Editing Issues

Insert Blank Pages Before Company Name Matches in a PDF

Elise WilliamsElise Williams Nov 19, 2026 868 views

Question details

Add a blank page before every PDF page containing a specified company name.

Insert Blank Pages Before Company Name Matches in a PDF
Product
Adobe Acrobat and WPS PDF
Device & OS
not provided
Scenario
A PDF has thousands of pages and needs blank pages inserted before pages that contain one or more company names.
Observed behavior
Each matching page should have one blank page immediately before it, without disrupting the identification of other matching pages.
Before you start

Confirm the company names and check that their text can be selected or found in the PDF. If the pages are scanned images, run OCR first; test the workflow on a copy and review matches before inserting pages.

Solution 1Recommended

Find matching pages and insert blanks with Acrobat JavaScript

Use Acrobat's JavaScript console to scan a large PDF and insert blank pages in reverse order.

This approach searches extracted page text, not unrecognized text in scanned images. It uses a case-insensitive substring match, so review the results for partial-name matches and text extraction errors.

Page creation requires an Acrobat edition and permissions that allow editing; this workflow is not intended for Adobe Acrobat Reader.

1
Open the JavaScript console

Open a copy of the PDF in Adobe Acrobat. Open Tools > JavaScript > Debugger, or use Ctrl+J on Windows, and select the Console.

2
Scan and review matches

Replace the example names below with the names to find. Paste and execute the code in the Console; on Windows, select the code and press Ctrl+Enter. Review the printed 1-based page numbers before continuing. var names = ['acme corporation', 'example company']; var found = []; for (var p = 0; p < this.numPages; p++) { var words = []; var count = this.getPageNumWords(p); for (var w = 0; w < count; w++) words.push(this.getPageNthWord(p, w, true)); var text = words.join(' ').toLowerCase(); if (names.some(function(name) { return text.indexOf(name.toLowerCase()) !== -1; })) found.push(p); } console.println('Matching pages: ' + found.map(function(p) { return p + 1; }).join(', '));

3
Insert pages in reverse order

After checking the results, execute this code in the same Console session: for (var i = found.length - 1; i >= 0; i--) this.newPage(found[i]);. Reverse order keeps the earlier matching page indexes unchanged as pages are inserted.

4
Inspect and save

Use the page thumbnails to check several inserted pages, including the first and last matches. Choose File > Save As to save the edited PDF under a new name.

Find matching pages and insert blanks with Acrobat JavaScript
Check text and page sizes: Extracted text order and stripped punctuation can affect matches, especially for company names with punctuation or unusual spacing. Newly inserted pages use Acrobat's default page size, so verify their dimensions if the PDF has mixed page sizes.
Edit PDFs with WPS

Insert blank pages manually in WPS PDF

Use WPS PDF to find company names and insert a blank page before each matching page. This manual approach is best for a small number of matches; it does not automate conditional insertion across thousands of pages.

  1. 1. Open the PDF: In WPS Office, open the PDF and display the page thumbnails so you can identify the current page.
  2. 2. Find a company name: Use the PDF search box or press Ctrl+F, enter a company name, and go to a matching page. The name must be searchable text.
  3. 3. Insert a blank page: Select the matching page in the thumbnails, then use the Page tools to insert a blank page before it. Menu labels and feature availability may vary by version or plan.
  4. 4. Repeat and save: Continue through the search results for each name, checking that each matching page has a blank page before it. Use File > Save As to save the edited PDF.
Search PDF text for company names and insert blank pages before selected pagesReview page order using PDF thumbnailsOpen and edit common Microsoft Office formats, including DOCX, XLSX, and PPTXUse a familiar interface for everyday document tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why can't Acrobat find a company name in my scanned PDF?

Scanned pages may contain only images. In Acrobat, use the Scan & OCR tools to recognize text, then search again and check the OCR results.

Why insert blank pages in reverse order?

Inserting a page changes the indexes of pages after it. Starting with the last matching page preserves the indexes of earlier matches.

Can the script search for more than one company name?

Yes. Add each name as a quoted entry in the names array. The script inserts one blank page per matching page, even if multiple names appear on it.

Will every inserted blank page match the surrounding page size?

Not necessarily. Acrobat's newPage method uses a default page size in this workflow. Inspect the inserted pages, especially in documents with mixed page sizes.

Can WPS PDF insert pages automatically based on company names?

The WPS workflow described here uses search and manual page insertion; it does not provide conditional batch insertion. For thousands of pages, use an automated PDF processing workflow instead.