Document processing
OCR on scanned manuals: how to do it and what goes wrong
OCR on scanned manuals: render pages at 300 DPI, run OCRmyPDF or Tesseract, then check a hand-typed sample for digit errors. Commands and fixes.
Oct 12, 2026 · Updated Nov 9, 20266 min read14 sources
Why it matters
A misread digit in a part number or a torque value looks valid and is wrong. On a maintenance manual that is a safety problem, not a typo.
The short version
- 1For a scanned PDF manual, run ocrmypdf --rotate-pages --deskew --clean in.pdf out.pdf. It adds a searchable text layer and keeps the page images.
- 2Most OCR errors start with the scan: under 300 DPI, skewed, noisy, or with dark borders. Fix the image before you blame the engine.
- 3Check accuracy on 5 to 10 of your own pages typed by hand. Count digit errors separately, because a wrong digit makes a valid-looking wrong part number.
To OCR a scanned manual, get each page as an image at 300 DPI or more, clean it up, run an OCR engine, and check a hand-typed sample for digit errors. For a scanned PDF, one OCRmyPDF command does the first three steps and adds a searchable text layer (OCRmyPDF).
The check matters on a manual. A misread digit in a part number or torque value looks valid and is wrong.
The quick way: OCRmyPDF
OCRmyPDF runs Tesseract on each page of a PDF and adds an invisible text layer, so the file looks the same but can be searched and copied (OCRmyPDF Cookbook).
# Install (macOS or Debian/Ubuntu)
brew install ocrmypdf
sudo apt install ocrmypdf
# Fix rotation, straighten, clean noise, then OCR
ocrmypdf --rotate-pages --deskew --clean manual.pdf manual_ocr.pdf
# Another language, or two
ocrmypdf -l eng+fra --deskew manual.pdf manual_ocr.pdf
# Also write the recognized text to a .txt file
ocrmypdf --sidecar manual.txt manual.pdf manual_ocr.pdf
Install commands are from the installation page. What each option does:
| Option | What it does |
|---|---|
--rotate-pages | Turns pages scanned sideways or upside down |
--deskew | Straightens pages scanned a little crooked |
--clean | Cleans the page with unpaper before OCR, without changing the output image |
-l eng+fra | Sets languages. OCRmyPDF assumes English and cannot detect the language |
--sidecar file.txt | Writes the OCR text to a separate file |
--image-dpi 300 | Sets resolution for a single image with missing or wrong DPI |
The Cookbook warns that image processing can remove content on poor scans, so look at the output pages. Output is PDF/A by default; add --output-type pdf for a standard PDF.
If the PDF already has text
OCRmyPDF normally stops with an error on a file that already has OCR. Pick a mode (Cookbook):
--mode skip: OCR only pages that have no text.--mode redo: replace an old OCR layer without rasterizing pages. Try this first.--mode force: rasterize every page and OCR again. This can reduce quality and loses vector content.
The manual way: pdftoppm and Tesseract
Tesseract does not read PDFs (Input formats). Render the pages to images first with pdftoppm, which defaults to 150 DPI, so always pass -r 300 (pdftoppm manual).
# One grayscale PNG per page at 300 DPI (page-01.png and so on; padding depends on page count)
pdftoppm -r 300 -gray -png manual.pdf page
# List the pages, then OCR them into one searchable PDF and one text file
ls page-*.png > pages.txt
tesseract pages.txt manual_ocr pdf txt
# Word boxes and confidence for each word
tesseract page-01.png page-01 tsv
A text file that lists images gives one combined output per format (manual page). Use this route when you need per-word data or want to crop regions, such as a table, before OCR. The Tesseract OCR page covers page segmentation modes and model choice.
Scan settings: why 300 DPI
Scan text at 300 DPI or more. Tesseract works best at that resolution (Improving the quality of the output). The federal rule for digitizing permanent records sets the same floor: modern textual paper records at a minimum of 300 ppi, with a 2 percent tolerance (at least 294 ppi) (36 CFR 1236.50(d)).
If you control the scanner:
- Scan at 300 DPI or higher, grayscale or color.
- Lay pages flat and square to limit skew.
- Crop the dark edges around the page.
- Keep the original scans. OCR is a derived copy.
What goes wrong on manuals, and the fix
| Problem | Why it happens | Fix |
|---|---|---|
| Garbled text everywhere | Resolution under 300 DPI | Rescan, or render at -r 300 |
| Lines run together or break | Page is skewed | --deskew, or rotate until lines are level |
| Stray characters at page edges | Dark scanner borders read as text | Crop borders |
| Mush on stained or gray pages | Uneven background spoils black-and-white conversion | --clean, or --remove-background on pages without photos |
| Table values out of order | Tesseract reads lines, not cells | Find the table first with layout analysis |
| Handwritten notes lost | Tesseract is designed for printed text | Flag those pages for a person |
| Sideways pages unreadable | Wrong orientation | --rotate-pages |
The scan problems come from Tesseract's quality guide, which also says Tesseract has a known problem with tables without custom layout analysis. The FAQ says handwriting will not work very well. OCRmyPDF's Cookbook warns against --remove-background on documents with color photos.
Look-alike characters are the error that hurts most on a manual. A 1 read as l, or 0 as O, turns a part number into a different, valid-looking one. For a page of codes, limit the characters with -c tessedit_char_whitelist=... or turn off the dictionaries, as the quality guide describes.
How to check OCR accuracy
Measure on your own pages, not a vendor's test set.
- Pick 5 to 10 pages that carry risk: parts lists, torque tables, stamped or annotated pages.
- Type the correct text of each page by hand into
truth.txt. - OCR the same pages with your exact settings.
- Score them with the ISRI tools, ported as ocreval:
brew install eddieantonio/eddieantonio/ocreval
accuracy truth.txt ocr.txt accuracy_report.txt
wordacc truth.txt ocr.txt wordacc_report.txt
The accuracy report lists errors by edit type, accuracy by character class, and the most common confusions (ISRI user guide). Read the digit class first.
Character error rate (CER) is the insertions, substitutions, and deletions needed to fix the output, divided by the characters in the correct text (OCR-D quality assurance). Word error rate is the same count over words. One study of OCR for translation uses these bands (Ignat et al., 2022):
| CER | Quality |
|---|---|
| 1 to 2 percent | Good |
| 2 to 10 percent | Average |
| Over 10 percent | Poor |
A low average can still hide a wrong digit in a torque value. Report numbers and identifiers separately from running text.
How OCR errors reach search and translation
Search misses what OCR misread: a query for a part number will not match a page where one digit came out wrong. Translation degrades with noise too. In Ignat and colleagues' tests, up to about 4 percent CER made very little difference to BLEU scores. Substitutions did the most damage, about 6 BLEU lost at 20 percent CER (Ignat et al., 2022).
Keep the confidence and the location
Tesseract's TSV and hOCR output give every word a bounding box and a confidence score (Command Line Usage). Keep both. The score tells you which words to doubt. The box lets a reader open the original image at that word and check it.
What to do next
- Run
ocrmypdf --rotate-pages --deskew --cleanon one manual and search it for a known part number. - If you render pages yourself, pass
-r 300to pdftoppm. - Hand-type 5 to 10 risky pages and score them with
accuracy. - Check the digit error count before you trust part numbers or torque values.
- Keep per-word confidence and position with the text, from TSV or hOCR.
Azcuna's TRACE is one offline viewer for S1000D, MIL-STD-3001 XML, and PDF technical manuals. It keeps the source location and the markings of everything it shows and never modifies the source. It was proposed to NAVAIR under Navy SBIR Phase I topic DON26BZ05-NV078, and the proposal was submitted on September 23, 2026.
Questions people ask
How do I OCR a scanned PDF manual?
The shortest route is OCRmyPDF, which runs Tesseract on each page and adds an invisible, searchable text layer to the PDF. Install it with brew install ocrmypdf or apt install ocrmypdf, then run ocrmypdf with the rotate-pages, deskew, and clean options on the input and output files. Add a language code with -l, and add a sidecar file if you also want the plain text.
What DPI should I scan manuals at for OCR?
At least 300. Tesseract's documentation says it works best at 300 DPI or more. The federal rule for digitizing permanent records, 36 CFR 1236.50, requires modern textual paper records to be scanned at a minimum of 300 ppi, with a 2 percent tolerance. If you render PDF pages to images with pdftoppm, pass -r 300, because its default is 150 DPI.
What causes OCR errors on scanned manuals?
Mostly the scan. Tesseract's quality guide names low resolution, uneven or noisy backgrounds that spoil the black-and-white conversion, skew that breaks line finding, and dark scanner borders read as characters. Manuals add tables, which Tesseract reads poorly without layout analysis, and handwritten notes, which it is not designed for. Look-alike characters such as 1 and l, or 0 and O, then turn into wrong part numbers.
What is a good OCR error rate?
A study of OCR for machine translation by Ignat and colleagues uses three bands for character error rate: 1 to 2 percent is good, 2 to 10 percent is average, and above 10 percent is poor. Character error rate is the number of character insertions, substitutions, and deletions needed to fix the output, divided by the number of characters in the correct text.
Can I OCR a PDF that already has some text?
Yes. By default OCRmyPDF stops with an error on a file that already contains OCR text. Use mode skip to OCR only pages without text, mode redo to replace an earlier OCR layer without rasterizing the pages, or mode force to rasterize every page and OCR it again. Force can reduce quality and loses vector content, so try redo first.
How do OCR errors affect translation?
Ignat and colleagues injected OCR errors into text used to fine-tune translation models. Up to about 4 percent character error rate, BLEU scores changed very little. Substituted characters did more damage than inserted or deleted ones: about 2 BLEU lost at a 10 percent error rate and about 6 at 20 percent, against about 2 at 20 percent for insertions and deletions.
Sources
- 1OCRmyPDF documentation · OCRmyPDF project
- 2OCRmyPDF Cookbook · OCRmyPDF project
- 3Installing OCRmyPDF · OCRmyPDF project
- 4pdftoppm(1) manual page · Debian (poppler-utils)
- 5Input formats · Tesseract OCR project (tessdoc)
- 6tesseract(1) manual page · Tesseract OCR project (GitHub)
- 7Improving the quality of the output · Tesseract OCR project (tessdoc)
- 8FAQ (tessdoc | Tesseract documentation) · Tesseract OCR project (tessdoc)
- 9Command Line Usage · Tesseract OCR project (tessdoc)
- 1036 CFR Part 1236, Subpart E - Digitizing Permanent Federal Records · Code of Federal Regulations (govinfo)
- 11Quality Assurance in OCR-D · OCR-D specifications
- 12The ISRI Analytic Tools for OCR Evaluation, Version 5.1 (TR-96-02) · Information Science Research Institute, University of Nevada, Las Vegas (via the ocreval repository)
- 13ocreval: ISRI Analytic Tools for OCR Evaluation · GitHub (eddieantonio/ocreval)
- 14OCR Improves Machine Translation for Low-Resource Languages · arXiv (Ignat et al., ACL Findings 2022)
Where this shows up in our work
- TRACE, the offline S1000D and IETM viewer opens S1000D, MIL-STD-3001 and PDF technical manuals on a tablet with every marking intact.
- BABEL, offline multilingual translation and search translates and searches foreign-language documents on-device, every fact tied to its source passage.
