
PDF & Document Extraction
FreeEfficiently extract text from PDFs and scanned documents.
Free · Opens the source repo
What PDF & Document Extraction does
The PDF & Document Extraction skill is designed for users needing to extract text and data from PDF files and scanned documents. It leverages two primary extraction methods: pymupdf for text-based PDFs and marker-pdf for scanned documents requiring OCR capabilities. This skill is particularly useful for researchers, data analysts, and developers who work with a variety of document types and need reliable extraction tools.
For documents available online, the skill suggests using the web_extract function, which converts PDFs to markdown without requiring local dependencies. This is the preferred method when a document URL is accessible. For local files, users can choose between pymupdf, which is lightweight and fast, or marker-pdf, which provides advanced OCR features for scanned documents, equations, and complex layouts. The choice of extractor depends on the specific needs of the user, such as whether they require OCR or high accuracy in table extraction.
The skill includes helper scripts for both extraction methods, allowing users to easily extract text, images, tables, and metadata from their documents. Additionally, it provides functionality for splitting and merging PDFs, as well as searching for text across document pages. This makes it a versatile tool for anyone dealing with large volumes of documents or needing to process scanned materials efficiently.
Overall, this skill is ideal for anyone who frequently interacts with PDFs and scanned documents, offering a straightforward approach to text extraction while accommodating various document types and extraction requirements.
When to use it
Use this skill when you need to extract text from PDFs or scanned documents, especially when dealing with bulk processing or online resources.
When not to use it
This skill is not suitable for users who only need to create or edit Word or PowerPoint documents, as those tasks are better handled by dedicated skills.
What you can build with it
Extracting text from research papers
Researchers can use this skill to extract text and tables from PDFs of academic papers, streamlining their literature review process.
Processing scanned documents
Businesses can utilize the OCR capabilities of marker-pdf to digitize and extract information from scanned documents, improving data accessibility.
Batch processing of reports
Data analysts can automate the extraction of text from multiple PDF reports at once, saving time and increasing efficiency.
How to install PDF & Document Extraction
View source1. Install with the skills CLI
npx skills add nousresearch/hermes-agent/ocr-and-documents --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by nousresearchPDF & Document Extraction
For DOCX: see the docx skill (create/edit) or use python-docx for structured reads.
For PPTX: see the powerpoint skill (full create/read/edit support).
For PDF manipulation (merge, split, forms, watermarks, creation): see the pdf skill.
This skill covers text extraction from PDFs and scanned documents.
Coming from a
read_fileEXTRACTION COVERAGE WARNING?read_fileauto-converts local PDFs but reads the text layer only; the warning footer lists the pages that yielded no text (scanned images). For a handful of pages, render + vision is fastest:pdftoppm -jpeg -r 150 -f N -l N file.pdf /tmp/pagethenvision_analyzeeach image. For bulk OCR of many pages, use marker-pdf below (Step 2).
Step 1: Remote URL Available?
If the document has a URL, always try web_extract first:
web_extract(urls=["https://arxiv.org/pdf/2402.03300"])
web_extract(urls=["https://example.com/report.pdf"])
This handles PDF-to-markdown conversion via Firecrawl with no local dependencies.
Only use local extraction when: the file is local, web_extract fails, or you need batch processing.
Step 2: Choose Local Extractor
| Feature | pymupdf (~25MB) | marker-pdf (~3-5GB) |
|---|---|---|
| Text-based PDF | ✅ | ✅ |
| Scanned PDF (OCR) | ❌ | ✅ (90+ languages) |
| Tables | ✅ (basic) | ✅ (high accuracy) |
| Equations / LaTeX | ❌ | ✅ |
| Code blocks | ❌ | ✅ |
| Forms | ❌ | ✅ |
| Headers/footers removal | ❌ | ✅ |
| Reading order detection | ❌ | ✅ |
| Images extraction | ✅ (embedded) | ✅ (with context) |
| Images → text (OCR) | ❌ | ✅ |
| EPUB | ✅ | ✅ |
| Markdown output | ✅ (via pymupdf4llm) | ✅ (native, higher quality) |
| Install size | ~25MB | ~3-5GB (PyTorch + models) |
| Speed | Instant | ~1-14s/page (CPU), ~0.2s/page (GPU) |
Decision: Use pymupdf unless you need OCR, equations, forms, or complex layout analysis.
If the user needs marker capabilities but the system lacks ~5GB free disk:
"This document needs OCR/advanced extraction (marker-pdf), which requires ~5GB for PyTorch and models. Your system has [X]GB free. Options: free up space, provide a URL so I can use web_extract, or I can try pymupdf which works for text-based PDFs but not scanned documents or equations."
pymupdf (lightweight)
pip install pymupdf pymupdf4llm
Via helper script:
python scripts/extract_pymupdf.py document.pdf # Plain text
python scripts/extract_pymupdf.py document.pdf --markdown # Markdown
python scripts/extract_pymupdf.py document.pdf --tables # Tables
python scripts/extract_pymupdf.py document.pdf --images out/ # Extract images
python scripts/extract_pymupdf.py document.pdf --metadata # Title, author, pages
python scripts/extract_pymupdf.py document.pdf --pages 0-4 # Specific pages
Inline:
python3 -c "
import pymupdf
doc = pymupdf.open('document.pdf')
for page in doc:
print(page.get_text())
"
marker-pdf (high-quality OCR)
# Check disk space first
python scripts/extract_marker.py --check
pip install marker-pdf
Via helper script:
python scripts/extract_marker.py document.pdf # Markdown
python scripts/extract_marker.py document.pdf --json # JSON with metadata
python scripts/extract_marker.py document.pdf --output_dir out/ # Save images
python scripts/extract_marker.py scanned.pdf # Scanned PDF (OCR)
python scripts/extract_marker.py document.pdf --use_llm # LLM-boosted accuracy
CLI (installed with marker-pdf):
marker_single document.pdf --output_dir ./output
marker /path/to/folder --workers 4 # Batch
Arxiv Papers
# Abstract only (fast)
web_extract(urls=["https://arxiv.org/abs/2402.03300"])
# Full paper
web_extract(urls=["https://arxiv.org/pdf/2402.03300"])
# Search
web_search(query="arxiv GRPO reinforcement learning 2026")
Split, Merge & Search
pymupdf handles these natively — use execute_code or inline Python:
# Split: extract pages 1-5 to a new PDF
import pymupdf
doc = pymupdf.open("report.pdf")
new = pymupdf.open()
for i in range(5):
new.insert_pdf(doc, from_page=i, to_page=i)
new.save("pages_1-5.pdf")
# Merge multiple PDFs
import pymupdf
result = pymupdf.open()
for path in ["a.pdf", "b.pdf", "c.pdf"]:
result.insert_pdf(pymupdf.open(path))
result.save("merged.pdf")
# Search for text across all pages
import pymupdf
doc = pymupdf.open("report.pdf")
for i, page in enumerate(doc):
results = page.search_for("revenue")
if results:
print(f"Page {i+1}: {len(results)} match(es)")
print(page.get_text("text"))
No extra dependencies needed — pymupdf covers split, merge, search, and text extraction in one package.
Notes
web_extractis always first choice for URLs- pymupdf is the safe default — instant, no models, works everywhere
- marker-pdf is for OCR, scanned docs, equations, complex layouts — install only when needed
- Both helper scripts accept
--helpfor full usage - marker-pdf downloads ~2.5GB of models to
~/.cache/huggingface/on first use - For Word docs:
pip install python-docx(better than OCR — parses actual structure) - For PowerPoint: see the
powerpointskill (uses python-pptx)
Frequently asked questions about PDF & Document Extraction
Similar skills
Single-Cell RNA-seq QC
Automate quality control for single-cell RNA-seq data.
Instrument Data to Allotrope Converter
Standardize lab data for seamless integration.
SQL Server Table Reconciliation
Efficiently compare SQL Server tables across instances.
Data Cleaning and Variable Screening
Streamline credit risk data preprocessing for modeling.
Arize Dataset
Manage and query Arize datasets efficiently.
Spreadsheet Management
Efficiently create, edit, and analyze spreadsheet files.
