鲁梦河Menghe (Horace) Lu
Agent Skills

Searchable PDF OCR and Text Extraction

pdf-ocr-searchable

Run local macOS OCR for searchable PDFs and Markdown extraction.

macOS; OCRmyPDF, AppleOCR, Ghostscript and Poppler installed separately

Document version v1.0.1Packaged MIT

Download complete ZIP

Installation and setup guide

Detail page: https://www.lumenghe.com/en/skills/pdf-ocr-searchable/
Chinese guide: https://www.lumenghe.com/skills/pdf-ocr-searchable/install.txt
Document version: 1.0.1
Source commit: bed2dc83e0121a37a306860e90d6071b3e0815f9
Packaged on this site: 2026-10-24
Download: https://www.lumenghe.com/downloads/skills/pdf-ocr-searchable-1.0.1-20261024-bed2dc8.zip
SHA-256: bfc163facd36ad8b1da854f289c79a8c358e7bb1f52b1c0f090b21c2193c2059
Fixed filename: pdf-ocr-searchable-1.0.1-20261024-bed2dc8.zip
Expected download URL: https://www.lumenghe.com/downloads/skills/pdf-ocr-searchable-1.0.1-20261024-bed2dc8.zip

This guide installs the current complete package. The README on the page and inside the package preserves the skill’s full methods and boundaries. Installation follows the reader’s current authorization, actual host, and operating system. A guide inside the ZIP cannot contain the ZIP’s own checksum; use the package checksum on the detail page or public install.txt.

Before installation

  1. Identify the operating system, coding agent, and host; read the README and prerequisites. macOS only. Check Homebrew, uv, OCRmyPDF, ocrmypdf-appleocr, Ghostscript, and Poppler. OCRmyPDF and its plugin must share one Python environment. These dependencies are not included in the ZIP. Follow the README to install missing dependencies and check plugin availability. Without processing a real PDF, report dependency checks only; do not claim full OCR acceptance.
  2. Inspect ~/.agents/skills/pdf-ocr-searchable and same-named host entries without modifying them, including files, directories, symlinks, and broken symlinks. If an installation exists, report its version and local changes. Back it up and let the user choose how to merge or replace it; never silently overwrite, delete, or reset it. Do not alter unrelated host settings, other skills, or existing authentication.
  3. Download the complete ZIP from the HTTPS URL above into a temporary working directory. Compute its SHA-256 and compare it exactly with the current site release information. Stop if the digest is missing, still a template placeholder, or different. No access to the author’s GitHub repositories, git clone, or npx skills add owner/repo is needed.

Extract and install

  1. Inspect ZIP member paths before extraction. Require a single pdf-ocr-searchable/ root directory; reject absolute paths, .. traversal, and links that would write outside the destination. The complete package must contain pdf-ocr-searchable/SKILL.md, README.md, README.en.md, LICENSE, and the original supporting scripts and references. Do not download SKILL.md alone.
  2. Extract into a temporary directory and inspect the file list. Preserve relative structure and executable permissions; do not install an extra pdf-ocr-searchable/pdf-ocr-searchable/ nesting level. After confirming that the target does not exist, place the complete pdf-ocr-searchable/ folder at ~/.agents/skills/pdf-ocr-searchable/. Existing instructions and scripts refer to this canonical shared path, so do not relocate it casually.
  3. Configure discovery for the actual host. Codex reads personal skills from ~/.agents/skills; Claude Code reads personal entries from ~/.claude/skills. Only when ~/.claude/skills/pdf-ocr-searchable does not exist and is not a broken symlink, create a symlink pointing to ~/.agents/skills/pdf-ocr-searchable. Inspect and report existing entries instead of replacing them. Follow current official documentation for other hosts; do not claim every agent automatically scans the shared directory.

Verify and report

  1. Check that SKILL.md and the required scripts and references are readable, with the necessary executable permissions. Confirm discovery through the host’s skill list, an explicit invocation, or a new session. Distinguish files installed, skill discovered, dependencies ready, and a real task accepted; report only the checks actually performed. Use a minimal example that does not modify the user’s originals for any behavior that needs testing.
  2. Report the installation directory, source version and commit, downloaded checksum, discovery result, missing dependencies, and any backup location retained for an existing installation. Do not expose authentication values. Leave any interactive sign-in to the user.

Discovery references:

View the prompt for your agent

Copy this prompt into a coding agent that can read web pages and manage local files.

Turn scanned PDFs on a Mac into searchable documents with selectable, copyable text, and extract Markdown when needed. Processing runs locally and offline through Apple Vision / Live Text, for papers, books, and scanned reference material.

Use it as an Agent Skill or run the command-line scripts directly. Download the complete package from this site. The documentation identifies the version as 1.0.1; this site packages the verified source commit bed2dc8. This does not establish that a corresponding GitHub Release was published.

Features

Installation

Requires macOS, Homebrew, and uv. Live Text depends on system support; if unavailable, select --mode accurate. Downloading the ZIP from this site does not require Node.js or the skills CLI.

Ask your agent to install it

Give the detail-page URL to an online coding agent:

Read this page and its installation guide, then install pdf-ocr-searchable for my current host: https://www.lumenghe.com/en/skills/pdf-ocr-searchable/ . Download the complete ZIP linked on this page, verify its SHA-256, preserve any existing installation and local changes, and report whether the host discovers the skill.

The plain-text installation guide lists the package, shared installation path, prerequisites, and verification steps. It does not require access to my GitHub repositories.

Install the ZIP manually

  1. Download the complete ZIP. Compare its SHA-256 with the package information on the detail page before extracting it. On macOS, run shasum -a 256 "$HOME/Downloads/pdf-ocr-searchable-1.0.1-20261024-bed2dc8.zip" if the file is in Downloads.
  2. Extract the archive into a temporary working folder. It contains one pdf-ocr-searchable/ folder with SKILL.md, supporting files, and the license. Move that folder to ~/.agents/skills/pdf-ocr-searchable/. If a file, directory, or symlink already exists there, inspect and back it up before choosing how to update it; do not merge or overwrite it blindly.
  3. Configure discovery for your host. Codex reads personal skills from ~/.agents/skills. For Claude Code personal skills, add a symlink under ~/.claude/skills/ as shown below. Other hosts follow their own documented discovery rules; this shared directory is not automatically discovered everywhere.
mkdir -p ~/.claude/skills
if [ ! -e ~/.claude/skills/pdf-ocr-searchable ] && [ ! -L ~/.claude/skills/pdf-ocr-searchable ]; then
  ln -s ~/.agents/skills/pdf-ocr-searchable ~/.claude/skills/pdf-ocr-searchable
else
  printf '%s\n' 'An entry already exists; inspect it before making changes.'
fi

Keep the canonical files under ~/.agents/skills/pdf-ocr-searchable/: existing skill instructions and scripts refer to this path. After installation, check that SKILL.md exists and confirm the skill in the host’s list or a new session; a file on disk does not prove that it is loaded. The ZIP contains skill files, not the OCR runtime. Install the dependencies below separately.

Install dependencies

OCRmyPDF and the AppleOCR plugin must be installed in the same Python environment. These commands use Python 3.12:

uv tool install --python 3.12 ocrmypdf --with ocrmypdf-appleocr
brew install ghostscript poppler

Check that the plugin is available:

ocrmypdf --plugin ocrmypdf_appleocr --help 2>&1 | grep -q appleocr && echo OK

Quick start

These examples assume the skill is installed at ~/.agents/skills/pdf-ocr-searchable. If you use the scripts independently from another location, adjust the paths accordingly.

S=~/.agents/skills/pdf-ocr-searchable/scripts/ocr_pdf.sh

# Check whether a file needs OCR
"$S" --check "论文.pdf"

# Create 论文.ocr.pdf and retain the original
"$S" "论文.pdf"

# Also produce 论文.md
"$S" --md "论文.pdf"

# Process PDFs in a directory
"$S" ~/Scans/

# Deskew and recognize Traditional Chinese
"$S" --preset deskew --lang chi_tra "扫描件.pdf"

The script uses a text-density criterion to skip OCR for PDFs that already contain a text layer; with --md, it extracts Markdown directly. An existing output newer than the source is reused. Use --force to recognize the document again or change processing parameters; this redoes an existing text layer and rewrites the target output.

Choose a processing preset

Preset Intended use Image processing
archive (default) Preserve papers, books, and archival material Retain scanned images without re-encoding
deskew Correct tilted scans or photographs Rasterize pages and correct their rotation
compact Prioritize a smaller file Attempt optimization and image re-encoding; results depend on the input
"$S" --preset compact "资料.pdf"

By default, outputs are written beside the original with the suffix .ocr.pdf. Use --outdir to choose a destination or --suffix to change the suffix:

"$S" --outdir "./output" --suffix ".searchable" "资料.pdf"

Languages and recognition modes

The default language is Simplified Chinese, chi_sim. Select a language with --lang:

Language Parameter
Simplified Chinese chi_sim or zh-Hans
Traditional Chinese chi_tra or zh-Hant
English eng or en
Japanese jpn or ja
Korean kor or ko

Combined language strings such as chi_sim+eng are not supported. Chinese models may recognize some English within a page; spot-check proper names and references when a document contains substantial English.

--mode accepts livetext (default), accurate, or fast. Some Live Text failures automatically fall back to accurate, which you can also select directly. fast supports fewer languages and is unsuitable for Chinese documents.

"$S" --lang eng --mode accurate "paper.pdf"

Repair OCR debugging boxes

After OCR, supported AppleOCR debugging boxes are removed automatically. To repair an existing output, specify the PDF directly:

# Detect only; do not modify the file
"$S" --strip-boxes --dry-run "论文.ocr.pdf"

# Repair this file
"$S" --strip-boxes "论文.ocr.pdf"

# Repair *.ocr.pdf files in a directory
"$S" --strip-boxes ~/Scans/

The repair supports ordinary form fields and unsigned signature fields. It does not rewrite encrypted or already signed files. If cleanup fails, the script reports an error and stops subsequent Markdown generation for that file. See red-box compatibility and troubleshooting for supported formats and diagnostic steps.

Usage notes

Run "$S" --help to see all parameters.

Project files

SKILL.md                    # Agent skill entry point
scripts/ocr_pdf.sh          # PDF OCR and batch-processing entry point
scripts/pdf_to_md.py        # Convert a PDF text layer into Markdown
scripts/strip_ocr_boxes.py  # Repair AppleOCR debugging boxes
references/red-boxes.md     # Repair boundaries and troubleshooting
tests/test_red_boxes.py     # Regression tests for red-box repair

Acknowledgments

License

MIT

Package information and source
Document version
v1.0.1
Packaged
2026-10-24
ZIP size
34.8 KB
Files
12
Source commit
bed2dc83e0121a37a306860e90d6071b3e0815f9
SHA-256
bfc163facd36ad8b1da854f289c79a8c358e7bb1f52b1c0f090b21c2193c2059

This package is built from the checked local source snapshot, with distribution and installation documentation adapted for this site.

The README identifies version 1.0.1. A corresponding GitHub Release has not been verified.

GitHub source repositoryTemporarily unavailable