+8
日增长
+49
周增长
35,322
stars
2,456
forks
186
watchers
300
prs
1,388
issues
68
releases
README
[![PyPI version][pypi]](https://pypi.org/project/ocrmypdf/) ![Homebrew version][homebrew] ![ReadTheDocs][docs] ![Python versions][pyversions] [pypi]: https://img.shields.io/pypi/v/ocrmypdf.svg "PyPI version" [homebrew]: https://img.shields.io/homebrew/v/ocrmypdf.svg "Homebrew version" [docs]: https://readthedocs.org/projects/ocrmypdf/badge/?version=latest "RTD" [pyversions]: https://img.shields.io/pypi/pyversions/ocrmypdf "Supported Python versions" OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched or copy-pasted. bash ocrmypdf it's a scriptable command line program -l eng+fra it supports multiple languages --rotate-pages it can fix pages that are misrotated --deskew it can deskew crooked PDFs! --title "My PDF" it can change output metadata --jobs 4 it uses multiple cores by default --output-type pdfa it produces PDF/A by default input_scanned.pdf takes PDF input (or images) output_searchable.pdf produces validated PDF output See the release notes for details on the latest changes. Main features - Generates a searchable PDF/A file from a regular PDF - Places OCR text accurately below the image to ease copy / paste - Keeps the exact resolution of the original embedded images - When possible, inserts OCR information as a "lossless" operation without disrupting any other content - Optimizes PDF images, often producing files smaller than the input file - If requested, deskews and/or cleans the image before performing OCR - Validates input and output files - Distributes work across all available CPU cores - Uses Tesseract OCR engine to recognize more than 100 languages - Keeps your private data private. - Scales properly to handle files with thousands of pages. - Battle-tested on millions of PDFs. For details: please consult the documentation. Motivation I searched the web for a free command line tool to OCR PDF files: I found many, but none of them were really satisfying: - Either they produced PDF files with misplaced text under the image (making copy/paste impossible) - Or they did not handle accents and multilingual characters - Or they changed the resolution of the embedded images - Or they generated ridiculously large PDF files - Or they crashed when trying to OCR - Or they did not produce valid PDF files - On top of that none of them produced PDF/A files (format dedicated for long time storage) ...so I decided to develop my own tool. Installation Linux, Windows, macOS and FreeBSD are supported. Docker images are also available, for both x64 and ARM. | Operating system | Install command | | ----------------------------- | ------------------------------| | Debian, Ubuntu | apt install ocrmypdf | | Windows Subsystem for Linux | apt install ocrmypdf | | Fedora | dnf install
Top issues
#446Pdf error with tables21 comments · 2019-11-02#715extra space in the result pdf when the input pdf is in Chinese20 comments · 2021-01-15#12Option to remove blank pages19 comments · 2015-09-14#139Just saying thanks!!!17 comments · 2017-03-03#324--rotate-pages is being done but its results are ignored when --skip-text is enabled 16 comments · 2018-12-13#1584[Feature]: and support PaddlePaddle OCR in the backend12 comments · 2025-10-18#1086Only generate text files without generating PDF files12 comments · 2023-03-25#1015Inverted black and white from optimization9 comments · 2022-09-18
Discussions
#1784A Hebrew traineddata for `ocrmypdf -l heb_rivok` (Hebrew + English + digits)2 comments · 2026-11-07#1777Proposal: a workbench for reviewing disagreements between OCR backends3 comments · 2026-10-29#1770Adding "Indra" OCR as an alternative to Tesseract OCR0 comments · 2026-10-16#1767Tuning OCR for two-page spreads and multiple columns2 comments · 2026-10-14#1754REST API endpoints1 comments · 2026-09-23#1734Bounding Box margin for text1 comments · 2026-08-20#1717What is the current release?0 comments · 2026-07-17#1678Batch processing for auto page orientation (on windows 10 using anaconda prompt)0 comments · 2026-05-11
Latest release
v17.14.1 v17.14.1 2026-11-09Fixes - Fixed the RapidOCR engine offering no way to choose where its models are kept. They could only live in RapidOCR's package directory, which may be read-only, and models downloaded into a container's directory were lost when it exited. The new option --rapidocr-model-dir DIR (API: rapidocr_model_dir=; environment: OCRMYPDF_RAPIDOCR_MODEL_DIR) keeps all of RapidOCR's models, and the page orientation model, in the given directory, downloading any that are missing into it. python -m ocrmypdf.builtin_plugins.rapidocr_ocr download --model-dir DIR fills it in advance.