Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

OCRmyPDF

$ ocrmypdf Official Low Risk
OCRmyPDF · AI & Media · MPL-2.0 · macos / linux / windows

OCRmyPDF (ocrmypdf) uses Tesseract and Ghostscript/qpdf to add an invisible, searchable text layer to scanned PDFs while preserving image quality and optionally producing PDF/A archival files. It offers deterministic exit codes, --deskew, --sidecar plain-text extraction, and -q/--quiet for clean scripted pipelines.

FCRS-1.0 Score
82 /100
Good
Medium Confidence
Zero-Friction Install
brew install ocrmypdf
CLI vs MCP Decision CLI Only

ocrmypdf orchestrates local Tesseract, Ghostscript, and qpdf binaries directly over multi-page PDF files on disk.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 18 / 25

Fully non-interactive with --quiet, --sidecar text extraction, and documented numeric exit codes, though it has no --json output.

  • --quiet, --sidecar, and --output-type none support clean scripting
  • No --json output formatting
Trust & Safety 22 / 25

100% offline local processing with zero network access, explicit input/output file separation, and --skip-text safety against altering digital text.

  • Zero network calls; explicit input.pdf output.pdf separation
  • Deterministic exit codes for CI error handling
Setup & Portability 13 / 15

Available via brew install ocrmypdf (bundling Tesseract, Ghostscript, qpdf) on macOS/Linux as well as PyPI and Linux distro packages.

  • One-command brew install ocrmypdf includes native Tesseract/Ghostscript deps
Utility & Efficiency 12 / 15

Gold standard for searchable PDF/A generation, multi-core page parallelism (--jobs), deskewing, and sidecar text extraction.

  • Handles --deskew, --rotate-pages, --sidecar, and PDF/A output
Maintenance & Lineage 9 / 10

Long-running, mature official repository (ocrmypdf/OCRmyPDF) under MPL-2.0.

  • Official ocrmypdf/OCRmyPDF repo under MPL-2.0
Docs & Verifiability 8 / 10

Thorough ReadTheDocs manual including cookbook recipes and exit-code table.

  • Comprehensive ReadTheDocs manual and exit-code docs

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

Runs 100% locally offline with zero credentials or API keys.

Side Effects
Read-Only Local Write
Cost & Quotas

MPL-2.0 open-source CLI; completely free locally (note that bundled Ghostscript dependency is AGPLv3).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# OCRmyPDF CLI (ocrmypdf) Agent Rules
- Always write to a new output path (`ocrmypdf in.pdf out.pdf`) rather than overwriting `in.pdf` in place.
- Combine `--deskew` with `--skip-text` so PDFs that already contain text layers do not fail.
- Pass `-q` / `--quiet` in automated scripts to suppress progress bars.

Agent-Ready Command Recipes

Safe Read-Only Queries

Extract OCR text to a sidecar file without writing a PDF
ocrmypdf --output-type none --sidecar extracted.txt --quiet scanned.pdf -

Runs OCR and writes only the extracted plain text to extracted.txt without creating an output PDF.

Controlled Writes & Previews

Deskew and add a searchable text layer to a scanned PDF
ocrmypdf --deskew --skip-text --quiet scanned.pdf searchable.pdf

Straightens tilted scans, skips pages that already have text (--skip-text), and writes searchable.pdf.

Strengths for Agents

  • + One-command brew install ocrmypdf handles Tesseract and Ghostscript dependencies cleanly.
  • + Deterministic exit codes, --skip-text, and --sidecar make batch PDF pipelines reliable.

Caveats & Pitfalls

  • ! Outputs PDFs and plain-text --sidecar files rather than --json.
  • ! Passing --deskew on a PDF with an existing text layer fails unless --skip-text or --force-ocr is also provided.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI