# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, zypper 安装 ocrmypdf

查看 ocrmypdf 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:ocrmypdf
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install ocrmypdf
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install ocrmypdf
```

  证据: MacPorts ports tree: textproc/ocrmypdf/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add ocrmypdf
```

  证据: Alpine Linux edge package indexes: ocrmypdf from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install ocrmypdf
```

  证据: Debian stable package indexes: ocrmypdf from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install ocrmypdf
```

  证据: Fedora Rawhide package metadata: ocrmypdf from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#ocrmypdf
```

  证据: nixpkgs package indexes: ocrmypdf from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- zypper (92%):

```sh
sudo zypper install python313-ocrmypdf
```

  证据: openSUSE Tumbleweed package metadata: python313-ocrmypdf from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:ocrmypdf
- **软件包管理器:** Homebrew
- **版本:** 17.8.1
- **来源摘要:** Adds an OCR text layer to scanned PDF files
- **主页:** <https://ocrmypdf.readthedocs.io/en/latest/>
- **最后更新:** 2026-07-17T21:55:45Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- ocrmypdf (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 17.8.1
## 项目历史与用法

OCRmyPDF is a Python command-line application and library that adds an OCR text layer to scanned PDF files, making image-based documents searchable and copyable while preserving the original page images where possible.

### 项目历史

The project’s documentation frames OCRmyPDF around an awkward document-processing gap: PDF is the normal container for scanned documents, but existing scanned PDFs are difficult to modify. OCRmyPDF automates the pipeline of rasterizing pages, running OCR, inserting an invisible text layer, and writing a validated PDF or PDF/A output.

PyPI release history shows OCRmyPDF 3.0 published on 2015-09-05 and 4.2.2 on 2016-08-31, already advertising searchable PDF/PDF-A generation and preservation of embedded image resolution. Later documentation describes a public API, plugin support, image optimization, language packs, Docker usage, and feature-specific release notes, showing its expansion from a practical CLI into a packaged document-processing toolkit.

### 采用历史

OCRmyPDF’s adoption follows the shape of the scanned-document problem: Linux, macOS, and distribution packagers ship it because it wraps several hard-to-coordinate pieces into one reproducible CLI. The project is available through PyPI and package managers including Homebrew, Debian/Ubuntu, Fedora, MacPorts, Nix, Alpine, and openSUSE-family packages.

The project’s packaging notes thank downstream packagers and point to broad porting status, while the README badges and package metadata show attention to PyPI, Homebrew, Read the Docs, and Python-version compatibility. That packaging breadth is part of its appeal: users can install a single command rather than hand-assemble Tesseract, Ghostscript or pypdfium2, image preprocessing, PDF/A conversion, metadata handling, and validation steps.

### 使用方式

The common workflow is `ocrmypdf input.pdf output.pdf`, with options for languages, page rotation, deskewing, cleaning, metadata, job parallelism, output type, PDF optimization, and redoing or skipping existing OCR. The README emphasizes searchable PDF/A output, accurate placement of OCR text below images, lossless insertion where possible, image optimization, input/output validation, Tesseract language support, and scaling to large PDFs.

The project is also used as a library or scripted tool in document-ingestion systems. Its public API and plugin documentation exist for callers that need OCRmyPDF behavior inside larger PDF processing flows rather than only from a shell.

### 为什么软件包爱好者会关心

OCRmyPDF is packaging glue with real teeth: it turns a fragile OCR/PDF toolchain into one command while still exposing dependency choices, language-data packaging, Docker images, plugin hooks, and PDF/A policy. It is a good package-nerd example of a Python CLI whose value is orchestrating native tools and file-format edge cases cleanly.

### 时间线

- 2015-09-05: PyPI lists OCRmyPDF 3.0.
- 2016-08-31: PyPI lists OCRmyPDF 4.2.2 with the core searchable-PDF feature set.
- 2020s: release notes document continued work on PDF handling, API behavior, image optimization, plugins, rasterizer choices, and preservation of existing text layers.

### Related projects

- OCRmyPDF depends conceptually and operationally on Tesseract OCR, PDF/A tooling, Ghostscript or pypdfium2 rasterization paths, image preprocessing tools, Python PDF libraries, and distribution language-pack packages.

### 来源

- <https://github.com/ocrmypdf/OCRmyPDF/blob/master/README.md>
- <https://ocrmypdf.readthedocs.io/>
- <https://ocrmypdf.readthedocs.io/en/stable/installation.html>
- <https://ocrmypdf.readthedocs.io/en/stable/maintainers.html>
- <https://ocrmypdf.readthedocs.io/en/stable/releasenotes/index.html>
- <https://pypi.org/project/ocrmypdf/>
- <https://pypi.org/project/ocrmypdf/3.0/>
- <https://pypi.org/project/ocrmypdf/4.2.2/>
- source_facts.executables
- source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- Debian apt - ocrmypdf - 16.7.0+dfsg1-3: normalized package name match | Debian stable package indexes: ocrmypdf from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | add an OCR text layer to PDF files | https://github.com/jbarlow83/OCRmyPDF
- Debian apt - ocrmypdf-doc - 16.7.0+dfsg1-3: normalized package name match | Debian stable package indexes: ocrmypdf-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | add an OCR text layer to PDF files - documentation | https://github.com/jbarlow83/OCRmyPDF
- Nix - ocrmypdf: normalized package name match | nixpkgs package indexes: ocrmypdf from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - ocrmypdf - 15.2.0+dfsg1-1: normalized package name match | Ubuntu 24.04 LTS package indexes: ocrmypdf from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | add an OCR text layer to PDF files | https://github.com/jbarlow83/OCRmyPDF
- Ubuntu apt - ocrmypdf-doc - 15.2.0+dfsg1-1: normalized package name match | Ubuntu 24.04 LTS package indexes: ocrmypdf-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | add an OCR text layer to PDF files - documentation | https://github.com/jbarlow83/OCRmyPDF
- apk - ocrmypdf - 16.11.1-r2: normalized package name match | Alpine Linux edge package indexes: ocrmypdf from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Add OCR text layer to scanned PDF files | https://github.com/ocrmypdf/OCRmyPDF
- apk - ocrmypdf-pyc - 16.11.1-r2: normalized package name match | Alpine Linux edge package indexes: ocrmypdf-pyc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Precompiled Python bytecode for ocrmypdf | https://github.com/ocrmypdf/OCRmyPDF
- dnf - ocrmypdf - 16.12.0-3.fc45: normalized package name match | Fedora Rawhide package metadata: ocrmypdf from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Add an OCR text layer to scanned PDF files | https://github.com/ocrmypdf/OCRmyPDF
- dnf - ocrmypdf+watcher - 16.12.0-3.fc45: normalized package name match | Fedora Rawhide package metadata: ocrmypdf+watcher from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Metapackage for ocrmypdf: watcher extras | https://github.com/ocrmypdf/OCRmyPDF
- dnf - ocrmypdf-doc - 16.12.0-3.fc45: normalized package name match | Fedora Rawhide package metadata: ocrmypdf-doc from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | ocrmypdf documentation | https://github.com/ocrmypdf/OCRmyPDF
- zypper - python313-ocrmypdf - 17.4.2-1.3: normalized package name match | openSUSE Tumbleweed package metadata: python313-ocrmypdf from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | OCRmyPDF adds an OCR text layer to scanned PDF files | https://github.com/ocrmypdf/OCRmyPDF
- zypper - python314-ocrmypdf - 17.4.2-1.3: normalized package name match | openSUSE Tumbleweed package metadata: python314-ocrmypdf from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | OCRmyPDF adds an OCR text layer to scanned PDF files | https://github.com/ocrmypdf/OCRmyPDF
- MacPorts - ocrmypdf: normalized package name match | MacPorts ports tree: textproc/ocrmypdf/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/ocrmypdf.yml](https://github.com/mxcl/pkgdb/blob/main/combined/ocrmypdf.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
