Tesseract’s –psm option tells the engine what layout to assume. The manual lists mode 4 as assuming a single column of text of variable sizes, which is the right assumption for a plain one-column letter — and the wrong one for a newspaper.
Use the practice file
A practice document, practice-single-column.pdf. The file is fictional.
| Page | Content |
|---|---|
| 1 | Single-column letter, 14 lines |
| 2 | Single-column report, 20 lines, including the word “harvest” |
| 3 | Single-column notes, 6 lines |
Page 2 is the check page: the word “harvest” appears there once.
Check mode 4 on a single column
Expected result. We checked the OCRmyPDF manual and the Tesseract manual. We did not run any tool. The checks below are what to expect if the work is done correctly; run them yourself on the practice file.
1. Run Tesseract with –psm 4
Run tesseract page2.png out –psm 4 on a render of page 2.
Expected result: Tesseract produces a text file for the page.
2. Read the output in order
Open the text file and read it top to bottom.
Expected result: The 20 lines appear in page order, with no line repeated or missing.
3. Search the output
Search the text file for “harvest”.
Expected result: 1 hit, matching the visible word on page 2.
4. Compare with the default mode
Run the same page with –psm 3 and compare the two outputs.
Expected result: Both read correctly here; mode 4 is chosen for its explicit assumption, not because the default failed.
Verdict table
| Check | Expected result | Pass? |
|---|---|---|
| Run Tesseract with –psm 4 | Tesseract produces a text file for the page. | — |
| Read the output in order | The 20 lines appear in page order, with no line repeated or missing. | — |
| Search the output | 1 hit, matching the visible word on page 2. | — |
| Compare with the default mode | Both read correctly here; mode 4 is chosen for its explicit assumption, not because the default failed. | — |
Related guides: How to Batch OCR a Multi-Page PDF with Consistent Settings — How to Add a Searchable Text Layer to a Scanned PDF.
Limits
- A page segmentation mode is an assumption about layout, not a quality setting: the right mode matches the page in front of you.
- Command-line OCR rewrites the file, so always work on a copy and keep the original scan untouched.
- UNTESTED — no OCR tool was run; all results above are expected results. The practice file is fictional.
Sources
- OCRmyPDF manual, “ocrmypdf(1) — add an OCR text layer to scanned PDF files” — Modes default, force, skip, redo and strip; –sidecar writes the recognized text; –pages limits OCR to chosen pages. Checked 2026-11-28.
- Tesseract manual, “tesseract(1) — command-line OCR engine” — Default language is English; -l takes 3-character ISO 639-2 codes, joined with + for several languages; –list-langs lists installed packs; –psm sets the page segmentation mode. Checked 2026-11-28.
