New Tool Radar

AI PDF

How to Use OCRmyPDF force-ocr and Check What It Does to Form Fields

Use --force-ocr only on a copy, and check that form fields were flattened before you file the result.

Schematic with three numbered boxes: work on a copy, run force-ocr, check fields flattened.

OCRmyPDF documents that –force-ocr rasterizes all pages to images, discarding any hidden OCR text and rasterizing printable text, and it flattens form fields and interactive objects into their visual representation. That is the right tool when the text layer is corrupt, but it destroys fillable fields, so use it on a copy and check the result.

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 PDF with a corrupt text layer or fillable form fields
  • A copy of the PDF to test on

Steps

1. Work on a copy

Copy the PDF and run –force-ocr on the copy only, keeping the original safe.

Expected result: A copy is made and the original is untouched.

2. Run –force-ocr

Run ocrmypdf –force-ocr on the copy, writing to a new output file.

Expected result: A new output file is created.

3. Check the form fields are flattened

Open the output and try to click into a form field. It should no longer be editable.

Expected result: Fields are confirmed flattened, not fillable.

4. Check the text searches

Search the output for a word from the page and confirm it is found.

Expected result: The search finds the word, so the new text layer works.

Worked example

A practice form has 3 fillable fields and a corrupt text layer. The –force-ocr run fixed the text and flattened the fields.

Field Fillable before? Fillable after?
Name Yes No
Date Yes No
Amount Yes No

Expected result: All three fields are flattened and the text searches, so the output is filed as a read-only copy (UNTESTED – confirm it yourself.)

Verdict table

Check Expected result Pass?
Work on a copy A copy is made and the original is untouched. –
Run –force-ocr A new output file is created. –
Check the form fields are flattened Fields are confirmed flattened, not fillable. –
Check the text searches The search finds the word, so the new text layer works. –

Limits

  • Flattened fields cannot be filled in again; keep the original if the form is still in use.
  • –force-ocr re-rasterizes every page, so it is slower and can change image quality.

Sources

See all