ocr-and-documents

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

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/vivekgoquest/hermes-agent-stable --skill ocr-and-documents-vivekgoquest
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ocr-and-documents
Source: https://github.com/vivekgoquest/hermes-agent-stable/tree/main/skills/productivity/ocr-and-documents
Command: npx skills add https://github.com/vivekgoquest/hermes-agent-stable --skill ocr-and-documents-vivekgoquest

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Getting usable text out of PDFs is inconsistent: text-based PDFs need lightweight parsing, while scanned documents, equations, and complex layouts require full OCR. This Skill routes each document to the right extractor so you get clean text or Markdown without trial and error. ## Core Features & Use Cases - Dual-extractor routing: Uses pymupdf (~25MB, instant) for text-based PDFs and marker-pdf (~3-5GB) for scanned documents, OCR in 90+ languages, equations, forms, and complex layouts. - URL-first extraction: Tries web_extract for remote documents (including arXiv papers) before falling back to local processing. - PDF utilities: Splits, merges, and searches PDFs natively with pymupdf, plus metadata, table, and embedded-image extraction via helper scripts. - Use Case: You receive a scanned 50-page contract PDF. The Skill detects it has no text layer, runs marker-pdf OCR, and returns structured Markdown with tables and reading order preserved. ## Quick Start Extract the text from the attached scanned PDF and convert it to Markdown, using OCR if the pages have no text layer.

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 scanned PDF in Python?▼

Use marker-pdf for scanned PDFs since they have no text layer for standard parsers to read. It performs OCR in over 90 languages and outputs Markdown, but requires roughly 3-5GB of disk space for PyTorch and models.

pymupdf vs marker-pdf for PDF text extraction?▼

pymupdf is lightweight (~25MB) and instant, handling text-based PDFs, tables, and metadata. marker-pdf (~3-5GB) adds OCR, equation and LaTeX recognition, form handling, and reading-order detection for complex or scanned documents.

How to extract text from a PDF hosted at a URL?▼

Use web_extract on the URL first, which converts remote PDFs to Markdown via Firecrawl with no local dependencies. Only fall back to local extraction with pymupdf or marker-pdf when the file is local or web_extract fails.

Why does PDF text extraction return empty pages?▼

Empty output means those pages are scanned images without a text layer. For a few pages, render them with pdftoppm and analyze with a vision model; for bulk OCR across many pages, use marker-pdf.

Can pymupdf split and merge PDF files?▼

Yes, pymupdf handles splitting, merging, and text search natively with no extra dependencies. Use insert_pdf to copy page ranges between documents and page.search_for to locate text across all pages.

What are the limitations of pymupdf for document extraction?▼

pymupdf cannot perform OCR on scanned images, recognize equations or LaTeX, handle forms, or detect reading order. For those capabilities, switch to marker-pdf, which requires significantly more disk space and processing time.