Skip to content
Back to skills

Pdf Extract

ASecurity

Fast, zero-AI text extraction from PDFs that have a text layer (digitally created PDFs from Word, Typst, WeasyPrint, wkhtmltopdf, LaTeX, etc) with pymupdf - instant and deterministic. Use when the user wants to read a PDF or asks what it says, extract its text to a file, read specific pages, batch-extract a folder of PDFs, or get PDF metadata (title, author, page count). Do NOT use for scanned or image-only PDFs, or when this returns blank text - use ocr; for headings, tables, layout blocks o...

  • 95 stars
  • 0 votes
  • 1 copy
  • 16 views
  • Added September 6, 2026
developmentpythonbashgit

Security analysis

A100/100

Scanned November 13, 2026

npx -y skills add henkisdabro/wookstar-claude-plugins --skill pdf-extract --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pdf Extract?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pdf Extract
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/henkisdabro-pdf-extract/badge)](https://www.skillsdirectory.com/skills/henkisdabro-pdf-extract)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pdf-extract
description: Fast, zero-AI text extraction from PDFs that have a text layer (digitally created PDFs from Word, Typst, WeasyPrint, wkhtmltopdf, LaTeX, etc) with pymupdf - instant and deterministic. Use when the user wants to read a PDF or asks what it says, extract its text to a file, read specific pages, batch-extract a folder of PDFs, or get PDF metadata (title, author, page count). Do NOT use for scanned or image-only PDFs, or when this returns blank text - use ocr; for headings, tables, layout blocks or AI analysis of complex layouts - use document-parse; for forms, merging, splitting or table export to CSV/Excel - use pdf-processing-pro.
allowed-tools: Bash, Read, Write
---

# PDF text extraction

pymupdf through `uv run --with pymupdf` - it needs only [uv](https://docs.astral.sh/uv/getting-started/installation/), and the package is cached after the first run.

## 1. Extract

```bash
uv run --with pymupdf python3 -c "
import pymupdf
doc = pymupdf.open('/path/to/file.pdf')
for page in doc:
    text = page.get_text().strip()
    if text:
        print(text)
        print()
"
```

Adapt that loop to the request:

- **Save to file** - collect the page texts and write them joined with `'\n\n'`.
- **Specific pages** - index the document; pages are 0-indexed, so `doc[2]` to `doc[4]` are pages 3-5.
- **A folder** - loop over `glob.glob('/path/to/folder/*.pdf')` in one `uv run` and write a `.txt` beside each PDF.
- **Metadata** - `doc.metadata` holds `title`, `author` and `creator`; `len(doc)` is the page count.
- **Positioned or formatted text** - `get_text("blocks")` returns positioned blocks, `get_text("html")` returns HTML with formatting preserved.

Import the module as `pymupdf`. The old `fitz` alias still works but is deprecated and will be removed.

## 2. Check the output

Done when every requested page returned text. Blank or near-empty output means the PDF is a scan - hand it to the ocr skill.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.