pdf-ocr

Convert PDFs to auditable JSONL with text extraction or LLM vision OCR.

68|9|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/Jia-Hong-Peng/rag-to-skill --skill pdf-ocr-jia-hong-peng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf-ocr
Source: https://github.com/Jia-Hong-Peng/rag-to-skill/tree/main/pdf-ocr-skill
Command: npx skills add https://github.com/Jia-Hong-Peng/rag-to-skill --skill pdf-ocr-jia-hong-peng

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymupdf, and includes scripts (resource) components.

What problem does it solve?

The skill automates turning PDFs into auditable, per-page JSONL records by smartly choosing between direct text extraction and LLM-based vision OCR, ensuring compliance with hard rules and guardrails.

Core Features & Use Cases

  • Text extraction path using PyMuPDF when a PDF has a text layer, producing stable, token-free outputs.
  • LLM Vision path for scanned or image-based pages, rendering PNGs, applying vision-based transcription, and appending per-page records with strong progress tracking.
  • Hard rules guard: one-book-at-a-time, guard checks, manifest/final-report generation, and deletion gates for secure archival workflows.
  • Typical use: convert a single Chinese book to structured JSONL with chapter metadata and page-level records for QA, auditing, and sharing as Claude Code Skill inputs.

Quick Start

Process a PDF to produce per-page JSONL records with chapter metadata, selecting text extraction for text PDFs or LLM Vision for scanned PDFs.

Frequently Asked Questions about pdf-ocr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a scanned PDF to structured JSONL using OCR?

To convert a scanned PDF to JSONL, this skill renders image-based pages as PNGs and applies LLM vision OCR to transcribe text, appending per-page records with chapter metadata for structured output.

What is the best way to extract text from a PDF with an existing text layer into JSONL?

For PDFs with a text layer, the best way to extract text into JSONL is using PyMuPDF for direct text extraction, which produces stable, token-free outputs without requiring LLM vision OCR.

Does this PDF to JSONL conversion tool support batch processing and resume?

Yes, this PDF to JSONL conversion tool supports batch processing and resume capabilities, utilizing strict progress tracking and manifest generation to manage large conversion workflows.

Can I extract chapter metadata and per-page records from a single book PDF?

Yes, you can extract chapter metadata and per-page records from a single book PDF by applying hard-rule guards that enforce single-book locking during the JSONL conversion process.

What are the limitations of using PyMuPDF for PDF text extraction?

PyMuPDF is limited to extracting embedded text layers and cannot process scanned or image-based PDF pages, requiring the LLM vision OCR path to handle those files for successful JSONL conversion.

Why do I need guardrails like single-book locking for PDF OCR?

Guardrails like single-book locking are needed for PDF OCR to enforce hard rules, ensuring secure archival workflows, preventing concurrent processing conflicts, and maintaining manifest integrity.