ocr-and-documents

Extract text, tables, and images from PDFs and scanned documents using pymupdf or marker-pdf.

Updated May 4, 2026
One-click install
npx skills add https://github.com/Junkfooooood/hermes-governance --skill ocr-and-documents-junkfooooood
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ocr-and-documents
Source: https://github.com/Junkfooooood/hermes-governance/tree/main/skills/productivity/ocr-and-documents
Command: npx skills add https://github.com/Junkfooooood/hermes-governance --skill ocr-and-documents-junkfooooood

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymupdf, pymupdf4llm, marker-pdf, and includes scripts (resource) components.

What problem does it solve? Extracting text from PDFs and scanned documents is inconsistent: some files have embedded text, others are image-only scans requiring OCR, and complex layouts with tables or equations break naive parsers. This Skill provides a decision workflow for choosing the right extraction tool for each document type. ## Core Features & Use Cases - Lightweight extraction with pymupdf: Pull text, markdown, tables, images, and metadata from text-based PDFs with a ~25MB install, plus split, merge, and search operations. - High-quality OCR with marker-pdf: Handle scanned documents, equations, forms, and complex layouts in 90+ languages, with optional LLM-boosted accuracy. - Remote URL extraction: Use web_extract first for documents hosted online, including arxiv abstracts and full papers, with no local dependencies. - Use Case: You receive a scanned contract PDF. The Skill checks disk space, installs marker-pdf, runs OCR, and returns clean markdown with preserved tables and reading order. ## Quick Start Extract the text from my local file report.pdf and convert it to markdown, using OCR if the document is a scanned image.

Frequently Asked Questions about ocr-and-documents

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

FAQPage Schema
How do I extract text from a PDF in Python?

Use pymupdf to open the PDF and call get_text() on each page, or pymupdf4llm for markdown output. The extract_pymupdf.py script handles text, markdown, tables, images, and metadata via command-line flags.

pymupdf vs marker-pdf for PDF extraction?

pymupdf is lightweight (~25MB) and instant, handling text-based PDFs, tables, and images. marker-pdf (~3-5GB with PyTorch) adds OCR for scanned documents, equations, forms, and reading-order detection. Use pymupdf unless you need OCR or complex layout analysis.

How do I extract text from a scanned PDF?

Scanned PDFs require OCR since they contain images rather than text layers. Use marker-pdf, which supports OCR in 90+ languages, via the extract_marker.py script. pymupdf cannot perform OCR on scanned documents.

Does marker-pdf require a lot of disk space?

Yes, marker-pdf needs approximately 5GB free for PyTorch plus models, and downloads ~2.5GB of models to ~/.cache/huggingface/ on first use. Run extract_marker.py --check to verify disk space before installing.

Can I extract text from a PDF hosted at a URL?

Yes, use web_extract with the document URL first, which converts PDFs to markdown via Firecrawl with no local dependencies. Only fall back to local extraction when the file is local, web_extract fails, or batch processing is needed.

How do I split or merge PDF files in Python?

pymupdf handles splitting and merging natively with no extra dependencies. Use insert_pdf to copy page ranges into a new document for splitting, or combine multiple source documents into one for merging, then save the result.