ocr-and-documents

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

1|Updated Jun 24, 2026
One-click install
npx skills add https://github.com/maopujie10-sys/Bailongma --skill ocr-and-documents-maopujie10-sys
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ocr-and-documents
Source: https://github.com/maopujie10-sys/Bailongma/tree/main/skills/hermes-skills/productivity/ocr-and-documents
Command: npx skills add https://github.com/maopujie10-sys/Bailongma --skill ocr-and-documents-maopujie10-sys

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Getting usable text out of PDFs is inconsistent: text-based PDFs, scanned documents, equations, and complex layouts each need different tools, and picking the wrong extractor wastes time or produces garbled output. ## Core Features & Use Cases - Tiered extraction strategy: Try web_extract for remote URLs first, then lightweight pymupdf for text-based PDFs, then marker-pdf for OCR, equations, forms, and complex layouts. - Full PDF manipulation: Split, merge, and search PDFs natively with pymupdf, plus extract tables, images, metadata, and specific page ranges via helper scripts. - Arxiv and research workflows: Fetch abstracts or full papers from arxiv URLs and search for papers directly. - Use Case: You receive a scanned 40-page contract PDF. The skill detects it needs OCR, checks disk space, installs marker-pdf, and converts it to 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 scanned.

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 page.get_text() on each page, or pymupdf4llm for Markdown output. It installs in seconds at about 25MB and handles text-based PDFs, tables, images, and metadata.

pymupdf vs marker-pdf for PDF extraction?

pymupdf is lightweight (~25MB) and instant for text-based PDFs, tables, and images. marker-pdf (~3-5GB with PyTorch) adds OCR for scanned documents in 90+ languages, equations, forms, and reading-order detection.

How do I OCR a scanned PDF document?

Use marker-pdf, which performs OCR on scanned PDFs across 90+ languages and outputs Markdown. Run marker_single on a file or the provided extract_marker.py helper script; first use downloads about 2.5GB of models.

Can pymupdf extract text from scanned PDFs?

No, pymupdf cannot OCR scanned documents or images; it only reads existing text layers. For scanned PDFs, equations, or complex layouts, use marker-pdf or a remote URL with web_extract instead.

How do I split or merge PDF files in Python?

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

What should I do when marker-pdf needs too much disk space?

marker-pdf requires roughly 5GB for PyTorch and models. If space is insufficient, free up disk, provide a document URL so web_extract can handle conversion remotely, or fall back to pymupdf for text-based PDFs.