Skip to content

Scanning and OCR'ing PDF files

wsl ocrmypdf --deskew --force-ocr -r --rotate-pages-threshold 2.0 "input.pdf" "output.pdf"

On the Windows command line:

`for %f in (*.pdf) do wsl ocrmypdf —deskew —force-ocr -r —rotate-pages-threshold 2.0 “%f” “OCR/%f”

In a Windows batch file:

`for f” “OCR/%%f”

On MacOS:

`brew install ocrmypdf

`find . -name ‘*.pdf’ -printf ‘%p\n’ -exec ocrmypdf —deskew -r —rotate-pages-threshold 2.0 ’{}’ ‘OCR/{}’ ;

`find . -name ‘*.pdf’ | parallel —tag -j 2 ocrmypdf —rotate-pages —rotate-pages-threshold 2.0 ’{}’ ‘OCR2/{}’ ;

`find . -name ‘*.pdf’ | parallel —tag -j 2 ocrmypdf ’{}’ ‘OCR/{}’ ;