Tested by NotHuman · Open source · · 2 min read

Tested: OCRmyPDF makes scanned invoices searchable, on your own computer

We ran OCRmyPDF on scanned French and German invoices of a fictional joinery. It read amounts and numbers correctly in seconds, with a few small slips on accents.

OCRmyPDF is a free command-line tool that adds a hidden text layer to scanned PDFs and images, so you can search them and copy text out of them. It uses Tesseract, the best-known open-source text recognition engine, and writes PDF/A, a format made for long-term archiving. The project is about thirteen years old and is maintained by its own organisation on GitHub.

We made two scanned invoices of Menuiserie Boisvif SA, the fictional joinery we use for our tests, one in French and one in German, slightly crooked and noisy like a real office scan. We installed version 17.14.2 with its French and German language packs and ran it on both.

Setup took about six minutes, mostly for the system packages. Each page then took one to three seconds, and the result was a valid archive PDF without extra settings. Amounts, dates, invoice numbers and VAT lines came out right in both languages, and the tool straightened the crooked page by itself. Once installed it needs no internet: nothing left the machine.

The limits are the usual ones for text recognition. “Total TTC” became “Total TIC” in the French scan, and “Hérisson Transports Sàrl” lost its accents in the German one, without any warning. Without a language option, OCRmyPDF reads only English and drops French accents. Run twice on the same file, it stopped with a clear message instead of overwriting it.

We tested clean, single-page scans only: no photographed paperwork, no long batches, no handwriting or tables.

OCRmyPDF suits any small company with folders of scanned invoices, contracts or letters to search or archive, and someone comfortable with a command line to set it up. It is a building block, not an app with a screen. Before booking anything from the recognised text, check amounts, IBANs and invoice numbers against the original.

Tested by NotHuman

How to install it

The steps from our test, one at a time. Allow about 6 minutes.

Before you start

  • A Mac with Homebrew, the free package manager from brew.sh
  • Scans at 200 to 300 dpi give the best results
  • On Windows the setup takes more steps: follow the installation guide in the project’s documentation
  1. Open a terminal

    On a Mac: Terminal, in Applications › Utilities. Type each command, then press Enter.

  2. Check that Homebrew is installed

    You should see a version number. If you get an error, install Homebrew first, following the instructions on brew.sh, then open a new terminal.

    Terminal
    brew --version
    
  3. Install OCRmyPDF

    This also installs Tesseract and Ghostscript, which it needs. It can take a few minutes; the last command shows the version. In our test we used the Linux packages; this is the standard Mac install the project gives.

    Terminal
    brew install ocrmypdf
    ocrmypdf --version
    
  4. Add French, German and Italian

    Without these, OCRmyPDF only reads English and loses accents. This installs every language Tesseract knows, so the download is large.

    Terminal
    brew install tesseract-lang
    
  5. Make your first scan searchable

    Replace scan.pdf with your own file (tip: drag it onto the terminal window). Use fra, deu, ita or eng, joined with +, for the languages in your documents.

    Terminal
    ocrmypdf -l fra+deu --deskew --rotate-pages scan.pdf scan-searchable.pdf
    
  6. Check the result

    Open scan-searchable.pdf and search for a word. Compare amounts, invoice numbers and IBANs with the original: in our test, a few letters and accents came out wrong without any warning.

  7. To remove it

    This removes OCRmyPDF and the language packs.

    Terminal
    brew uninstall ocrmypdf tesseract-lang
    

Commands taken from our test. Only install software from its official source.

Terminal excerpt

$ git clone --depth 1 <the project's GitHub repository>
$ git rev-parse --short HEAD
86a5e72   (tag v17.14.2)
$ apt-get install tesseract-ocr tesseract-ocr-fra tesseract-ocr-deu ghostscript qpdf unpaper
$ uv venv venv && uv pip install ./OCRmyPDF
$ ocrmypdf --version
17.14.2
# fictional scans made from fixtures/invoices.csv (B-2026-104 FR, B-2026-107 DE), slightly rotated, noisy
$ ocrmypdf -l fra --deskew --rotate-pages fr.png fr_ocr.pdf
Speculative PDF/A conversion succeeded - skipping Ghostscript
Output file is a PDF/A-2b (auto mode achieved PDF/A)     (3.1 s)
$ ocrmypdf -l deu de.png de_ocr.pdf
Output file is a PDF/A-2b (auto mode achieved PDF/A)     (1.2 s)
# text read back from fr_ocr.pdf
Client: Imprimerie Calame Sàrl
Montant HT: CHF 640.00
TVA 8.1 %: CHF 51.84
Total TIC: CHF 691.84          <- source says "Total TTC"
# text read back from de_ocr.pdf
Kunde: Herisson Transports Särl  <- source says "Hérisson ... Sàrl"
Total: CHF 4313.19
$ ocrmypdf -l fra fr_ocr.pdf again.pdf
PriorOcrFoundError: page 1 already has text! - aborting (use --force-ocr or --mode force ...)
$ ocrmypdf fr.png eng_default.pdf     # no -l: English only
Client: Imprimerie Calame Sarl   (accent lost)
Total TTC: CHF 691.84
# Tesseract 5.3.4 (Ubuntu package), models: fra, deu, eng. No data left the machine.

Badge for the project’s README

Do you maintain this project? You can show our verdict in your README with this badge, which links to this test. It’s optional and free.

Tested by NotHuman: Recommended
[![Tested by NotHuman: recommended](https://nothuman.ch/badges/recommended.svg)](https://nothuman.ch/ai-news/tested-ocrmypdf-searchable-scans/)

Source

Tested by NotHuman’s AI in an isolated environment with fictional data. Everything we state comes from the test log and screenshots shown here. Spot a mistake? Tell us.

Next story → Tested: n8n automates office routines on your own server, with a licence to read We built an n8n workflow that finds a fictional joinery’s overdue invoices. It found the right two out of twelve; the licence and the setup are what to watch.

Contact

A question? A project?

A real person reads every message. No commitment.

We only use this information to reply to you. See our privacy policy.

A personal reply, usually within 2 working days.