Processing

OCR (Searchable PDFs)

Makes scanned PDFs and image files searchable by adding an invisible text layer with Windows' built-in OCR, without changing how the pages look.

PRO Command line: ocr Version 1.0
A Pro toolIn the free edition it works on up to 25 documents per run, so you can try it on real work. Compare Free and Pro.

OCR reads the words on each scanned page and places invisible text over them. The page looks exactly as it did, but its text can now be searched, selected, copied and extracted. Pages that already have text are left alone, and a PDF that needs nothing is copied byte for byte. A scanned page that carries only a little text, such as a Bates number stamped on the scan, is still read; the words under the existing stamp are left out so the stamp is not doubled.

Image files (TIFF, JPEG, PNG, BMP and GIF) become PDFs: one page per image, or per frame of a multi-page TIFF, at the image's own size. The tool uses the OCR engine built into Windows, so it works offline and no document leaves the PC. It reads the languages whose Windows OCR language pack is installed.

Use it when

How to run it

  1. Choose the folder of scanned PDFs and images as Input.
  2. Choose an Output folder outside the input folder.
  3. Leave language empty to read Windows' display language, or enter another installed language such as fr-FR.
  4. Leave Resolution (dpi) at 300 unless the print is very small.
  5. Click Run. The notes say which language was used and how many pages were read.
  6. Click Open report and check the Status and PagesNoTextFound columns.
  7. Check a few important documents by searching them for words you can see on the page.

Settings

Every setting has the same help beside it in the app. On the command line, pass each as --name value; ltk help ocr lists them.

Settings

SettingWhat it doesType and default
Language
--language
The language to read, e.g. en-GB, fr-FR or de-DE. Empty (default): Windows' display language. Other languages need their Windows OCR language pack: Settings > Time & language > Language & region > add the language (with its optical character recognition feature).
If Windows cannot read the chosen language, the run stops before it starts and lists the OCR languages that are installed. To add one: Settings > Time & language > Language & region, add the language, and include its optical character recognition feature. Characters outside the Windows-1252 set (for example Greek, Cyrillic or Asian scripts) are stored as ? in the searchable text; a note says how many pages this affected.
text
empty
Resolution (dpi)
--dpi
How finely PDF pages are rendered for reading, 150-600 dots per inch. 300 (default) suits most scans; try 400 for very small print. Images are read at their own resolution.
150 to 600. Higher values can help with very small print but take longer. This applies to PDF pages only; images are read at their own resolution.
number
300
Check for turned pages
--turned-pages
When a page reads poorly upright, also try it turned 90°, 180° and 270° and keep the way it reads best, so sideways and upside-down scans become searchable too. The page itself is not turned.
When a page reads poorly upright, it is also read turned 90°, 180° and 270°, and the best reading is kept. The page itself is not rotated. The Details column lists the pages that were read turned.
yes/no
true

Common settings

SettingWhat it doesType and default
Input required
--input
Folder (or single file) to read. It is opened read-only and never modified. folder
empty
Output required
--output
Folder for reports. Must not be inside the input folder. Each run gets its own sub-folder. folder
empty
Recurse
--recurse
Include sub-folders. yes/no
true
Extensions
--extensions
Only process these extensions (e.g. .pdf, .docx). Empty means the tool's default set. list
empty
Parallelism
--parallelism
Files processed at once. Use 1-2 for spinning disks or network shares. number
4

What you get

Each run creates its own folder inside the output folder, with the report ocr.csv, errors.csv and manifest.json (see Run folders and manifests).

Report columns

Check the result

Tips
  • Run Extract Text on the OCR output to get text files for the scanned documents.
  • For an image with no usable resolution in its file, the page size assumes 200 dpi; the Details column says so.
  • Scans that have already been Bates stamped can still be OCRed: the page is read and the existing stamp text is kept, not doubled.
Watch out for
  • OCR reads printed and typed text well, but handwriting, faint copies and very small print may be missed or misread. Do not rely on a search of OCR text to prove a document does not contain a word.
  • Adding a text layer changes the PDF, so OCRed files have different hashes from the originals. Keep the originals.
  • The free edition processes up to 25 documents per run.

From the command line

The command line is part of LitTechKit Pro. See Command line.

ltk run ocr --input "D:\Matter\Scans" --output "D:\Matter\Searchable" --language en-GB --dpi 300

Related tools