New Tool Radar

AI PDF

How to Fix OCRmyPDF Exiting on Pages That Already Have Text with skip-text

Use --skip-text so OCRmyPDF leaves searchable pages alone and only OCRs the scanned ones.

Schematic with three numbered boxes: check which pages have text, run with skip-text, verify all pages.

By default, OCRmyPDF exits without modifying a PDF when a page seems to have text already. That is the documented behaviour: if –skip-text is issued, no OCR is performed on pages that already have text, while –force-ocr rasterizes everything and –redo-ocr re-analyses the text. Use –skip-text when only some pages are scans.

Checked on 2026-11-29. We did not run any tool for this guide. Every result below is an expected result, marked UNTESTED, for you to confirm on your own files.

Prerequisites

  • OCRmyPDF installed
  • A mixed PDF with some searchable pages and some scanned pages
  • A copy of the PDF to test on

Steps

1. Check which pages have text

Open the PDF and search for a word on each page to see which pages are already searchable.

Expected result: Each page is marked searchable or scanned.

2. Run with –skip-text

Run ocrmypdf –skip-text on a copy of the file, writing to a new output.

Expected result: The command completes without the already-has-text exit.

3. Check the scanned pages gained text

Search the output for a word from a scanned page.

Expected result: The word is found on the scanned page.

4. Check the searchable pages are unchanged

Search the output for a word from a page that already had text, and compare the page count.

Expected result: The page count matches and the old text still searches.

Worked example

A practice PDF has 4 pages: 2 searchable and 2 scanned. The –skip-text run fixed the scanned pages only.

Page Had text? Text after run?
Page 1 Yes Yes
Page 2 No Yes
Page 3 Yes Yes
Page 4 No Yes

Expected result: All four pages are searchable after the run and the page count stays at 4 (UNTESTED – confirm it yourself.)

Verdict table

Check Expected result Pass?
Check which pages have text Each page is marked searchable or scanned. –
Run with –skip-text The command completes without the already-has-text exit. –
Check the scanned pages gained text The word is found on the scanned page. –
Check the searchable pages are unchanged The page count matches and the old text still searches. –

Limits

  • A page with a little text, such as a footer, counts as having text and will be skipped; check such pages by hand.
  • –skip-text does not fix a page whose text layer is wrong; use –redo-ocr for that.

Sources

See all