pdfblah.com

← All guides

OCR a scanned PDF

A scan is a picture of words: nothing to search, nothing to copy. OCR reads the words off the image and lays an invisible, selectable text layer over each page. The scan looks exactly the same, but now it searches and copies like a normal PDF.

Local only. OCR is not on pdfblah.com; it runs entirely on your own machine, free, as part of the open source pdfblah CLI. Nothing is uploaded, which also makes it the right way to OCR anything sensitive.

What it does

Each page image is left exactly as it was. Tesseract (the same engine behind most serious OCR tools) recognizes the words, and a hidden text layer is placed underneath, aligned to the image. You get:

One honest caveat: OCR is for search and extraction, not editing. The hidden layer uses a subset OCR font, so pdfblah's own find and replace will usually refuse to edit it. That is the font-safety gate doing its job and protecting you from garbled output.

Make it a right-click on your Mac

One command installs a Finder Quick Action called Make Searchable. It sets up the pdfblah CLI with its OCR engine (Tesseract and Ghostscript via Homebrew), and everything runs on your machine.

curl -fsSL https://pdfblah.com/ocr-mac.sh | sh

Then select any number of scanned PDFs in Finder, right-click, and choose Quick Actions → Make Searchable. Searchable copies land in ~/Downloads/searchable as name-ocr.pdf, each with its .ocr.txt text file, and the folder opens when the batch finishes.

From the command line

Works on macOS, Linux, and Windows. OCR needs two system tools, Tesseract and Ghostscript; pdfblah doctor --install fetches them for you (apt or Homebrew).

pip install "pdfblah[ocr]"
pdfblah doctor --install

# basic: a searchable copy
pdfblah ocr scan.pdf -o searchable.pdf

# also save the recognized words as plain text
pdfblah ocr scan.pdf -o searchable.pdf --sidecar scan.txt

# crooked or upside-down scans
pdfblah ocr scan.pdf -o searchable.pdf --deskew --rotate

# a whole folder
for f in *.pdf; do pdfblah ocr "$f" -o "searchable/${f%.pdf}-ocr.pdf"; done

Languages are modular

English usually comes with Tesseract. Every other language is one downloadable file: grab exactly the ones you need, no package manager or admin rights involved.

# what you have now
pdfblah ocr --langs

# grab German and French (one small file each, into ~/.pdfblah/tessdata)
pdfblah ocr --get-lang deu,fra

# then mix them freely
pdfblah ocr scan.pdf -o searchable.pdf --lang eng+deu

--get-lang downloads from the official Tesseract data repos; add --best for the larger, higher-accuracy models. Codes look like deu, fra, chi_sim; the full list has over a hundred.

Tips