---
name: "tesseract-ocr-searchable-pdf"
description: "Convert scanned paper documents and images into searchable sandwich PDF files with OCR."
metadata:
  author: "Tesseract OCR"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "convert scanned pdf to searchable"
  - "run tesseract ocr on image"
  - "deskew and ocr document"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Tesseract OCR Searchable Sandwich PDF

Integrates Tesseract OCR engine (pytesseract, ocrmypdf) to detect page skew, recognize multilingual text characters, and inject an invisible, searchable text layer beneath scanned images.

## When to Invoke
Invoke this skill whenever you need to:
- convert scanned pdf to searchable
- run tesseract ocr on image
- deskew and ocr document

## Execution SOP & Rules
1. Use ocrmypdf --deskew --clean input.pdf output_searchable.pdf for automated processing.
2. Specify multiple language packs with -l eng+spa to accurately capture foreign terms.
3. Ensure input images have a minimum resolution of 300 DPI for high recognition accuracy.
4. Verify OCR text layer alignment against original raster images to ensure proper selection.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
