Force-redo OCR without losing quality

ocrmypdf --force-ocr --clean --pdf-renderer sandwich --output-type pdf --oversample 600 input.pdf output.pdf


ocrmypdf --help

Add an OCR layer and convert to PDF/A

ocrmypdf input.pdf output.pdf

Add an OCR layer and output a standard PDF

ocrmypdf --output-type pdf input.pdf output.pdf

Create a PDF/A with all color and grayscale images converted to JPEG

ocrmypdf --output-type pdfa --pdfa-image-compression jpeg input.pdf output.pdf

Modify a file in place

The file will only be overwritten if OCRmyPDF is successful.

ocrmypdf myfile.pdf myfile.pdf

Correct page rotation

OCR will attempt to automatic correct the rotation of each page. This can help fix a scanning job that contains a mix of landscape and portrait pages.

ocrmypdf --rotate-pages myfile.pdf myfile.pdf