pymupdf-pdf

Parse PDF files into Markdown and JSON with optional image and table extraction using PyMuPDF.

39|1|Updated Jul 2, 2026
One-click install
npx skills add https://github.com/HKU-MMLab/UniClawBench --skill pymupdf-pdf-hku-mmlab
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pymupdf-pdf
Source: https://github.com/HKU-MMLab/UniClawBench/tree/main/injection/101_skill_usage/task_101_26_arxiv_metadata_pack/skills/pymupdf-pdf-parser-clawdbot-skill
Command: npx skills add https://github.com/HKU-MMLab/UniClawBench --skill pymupdf-pdf-hku-mmlab

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Extracting text and content from PDF documents often requires heavy OCR pipelines or slow layout-aware parsers. This Skill provides fast local PDF parsing with PyMuPDF, producing Markdown or JSON output in about one second per page when speed matters more than layout fidelity. ## Core Features & Use Cases - Fast text extraction: Convert PDFs to Markdown with page markers or to simple per-page JSON using PyMuPDF (fitz). - Optional image and table extraction: Pull embedded images into an images folder and generate rough line-based table JSON with command-line flags. - Per-document output folders: Each parsed PDF gets its own directory under a configurable output root containing output.md, output.json, images, and tables.json. - Use Case: A researcher needs to quickly extract text from a batch of arXiv papers to build a metadata pack. Running the parser on each PDF produces clean Markdown files in seconds without downloading multi-gigabyte models. ## Quick Start Ask the agent to parse a PDF file with the pymupdf_parse.py script, for example by requesting Markdown output from a specific document path into the default pymupdf-output folder.

Frequently Asked Questions about pymupdf-pdf

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

FAQPage Schema
How do I extract text from a PDF using PyMuPDF?▼

Run the pymupdf_parse.py script with the PDF path as the argument. By default it writes Markdown with page markers to output.md inside a per-document folder under ./pymupdf-output, using page.get_text with markdown or text mode.

PyMuPDF vs MinerU for PDF parsing, which should I use?▼

PyMuPDF is fast at roughly one second per page and produces minimal text-only output, while MinerU is slower at 15-30 seconds per page but preserves layout and produces rich structured JSON. Use PyMuPDF for speed and simple extraction, MinerU for complex layouts.

Can PyMuPDF extract images from PDF files?▼

Yes, pass the --images flag to the parser script. It iterates page.get_images and saves each embedded image as a PNG in an images subdirectory, converting color spaces to RGB when needed.

Why does PyMuPDF fail to import with a libstdc++ error on NixOS?▼

On NixOS the fitz module may fail because libstdc++ is not on the library path. Locate a gcc lib path under /nix/store and export it via LD_LIBRARY_PATH, as documented in references/pymupdf-notes.md.

What are the limitations of PyMuPDF table extraction?▼

PyMuPDF does not provide robust table extraction. The --tables flag only returns line-based text per page as a rough approximation, so complex or merged-cell tables require a dedicated layout-aware parser instead.