pdf-text-extractor

Extract text from PDF files with intelligent chunking and metadata preservation. For batch extraction (1K+ PDFs), use pdftotext (poppler) via subprocess — see pdf skill Tool Selection table. For single-doc quality, use Codex or PyMuPDF. Supports technical documents, standards libraries, research papers, or any PDF collection.

5 stars

Best use case

pdf-text-extractor is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Extract text from PDF files with intelligent chunking and metadata preservation. For batch extraction (1K+ PDFs), use pdftotext (poppler) via subprocess — see pdf skill Tool Selection table. For single-doc quality, use Codex or PyMuPDF. Supports technical documents, standards libraries, research papers, or any PDF collection.

Teams using pdf-text-extractor should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/text-extractor/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/data/documents/pdf/text-extractor/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/text-extractor/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pdf-text-extractor Compares

Feature / Agentpdf-text-extractorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Extract text from PDF files with intelligent chunking and metadata preservation. For batch extraction (1K+ PDFs), use pdftotext (poppler) via subprocess — see pdf skill Tool Selection table. For single-doc quality, use Codex or PyMuPDF. Supports technical documents, standards libraries, research papers, or any PDF collection.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Pdf Text Extractor

## Overview

This skill extracts text from PDF files using PyMuPDF (fitz), with intelligent chunking, page tracking, and metadata preservation. Handles large PDF collections with batch processing and error recovery.

**Tool selection** (see `pdf` skill Tool Selection table for full guidance):
- **Batch (1K+ PDFs)**: pdftotext (poppler) via `subprocess.run(timeout=30)` — 37x faster, reliable timeouts
- **Single doc quality**: OpenAI Codex PDF→Markdown (best understanding)
- **Single doc text**: PyMuPDF (fitz) — fast, good API

> **WARNING (WRK-1277)**: Do NOT use pdfplumber in multiprocessing pools. It hangs in
> kernel D-state on NTFS/NFS mounts — uninterruptible by SIGALRM. Use pdftotext via
> subprocess for all parallel/batch work.

**Note:** The doc-intelligence pipeline uses pdfplumber for single-document extraction.
For bulk extraction across the 1M+ corpus, use pdftotext via subprocess (see
`pdf/pdftotext-poppler` sub-skill for the proven batch pattern).

## Quick Start

**Recommended Approach (with Codex conversion):**
```python
# 1. Convert PDF to markdown first (see pdf skill)
from pdf_skill import pdf_to_markdown_codex

md_path = pdf_to_markdown_codex("document.pdf")

# 2. Process the markdown
with open(md_path) as f:
    markdown = f.read()
    # Work with structured markdown
```

**Direct Extraction (when Codex not needed):**
```python
import fitz  # PyMuPDF

doc = fitz.open("document.pdf")
for page in doc:
    text = page.get_text()
    print(text)
doc.close()
```

## When to Use

- Processing PDF document collections for search indexing
- Extracting text from technical standards and specifications
- Converting PDF libraries to searchable text databases
- Preparing documents for AI/ML processing
- Building knowledge bases from PDF archives

## Related Skills

- `knowledge-base-builder` - Build searchable database from extracted text
- `semantic-search-setup` - Add vector embeddings for AI search
- `document-inventory` - Catalog documents before extraction

## Version History

- **1.3.0** (2026-03-17): WRK-1277 learnings — pdftotext preferred for batch; D-state/NFS/NTFS warnings; fixed duplicate Sub-Skills sections; updated tool selection guidance
- **1.2.0** (2026-01-04): Added OpenAI Codex workflow recommendation as preferred approach; updated Quick Start to show Codex-first workflow; added reference to `pdf` skill for markdown conversion
- **1.1.0** (2026-01-02): Added Quick Start, Execution Checklist, Error Handling, Metrics sections; updated frontmatter with version, category, related_skills
- **1.0.0** (2024-10-15): Initial release with PyMuPDF, batch processing, OCR support, metadata extraction

## Sub-Skills

- [Best Practices](best-practices/SKILL.md)
- [Execution Checklist](execution-checklist/SKILL.md)
- [Error Handling](error-handling/SKILL.md)
- [Metrics](metrics/SKILL.md)
- [Dependencies (+5)](dependencies/SKILL.md)
- [Features](features/SKILL.md)
- [Readability Classification](readability-classification/SKILL.md)
- [Encrypted PDFs (+2)](encrypted-pdfs/SKILL.md)
- [Example Usage](example-usage/SKILL.md)

Related Skills

sodir-data-extractor

5
from vamseeachanta/workspace-hub

Extract and process Norwegian Petroleum Directorate field and production data from SODIR

bsee-data-extractor

5
from vamseeachanta/workspace-hub

Extract and process BSEE (Bureau of Safety and Environmental Enforcement) data including production, WAR (Well Activity Reports), and APD (Application for Permit to Drill) data. Use for querying production data, well activities, drilling permits, completions, and workovers by API number, block, lease, or field with automatic data normalization and caching.

context-compaction-handoff

5
from vamseeachanta/workspace-hub

Guardrails for resuming work after context compaction or transcript handoff blocks; prioritize the latest real user request over stale summarized tasks and verify before answering.

wiki-context

5
from vamseeachanta/workspace-hub

Auto-query llm-wiki domains for relevant context before executing domain tasks

pdf-text-extractor-readability-classification

5
from vamseeachanta/workspace-hub

Sub-skill of pdf-text-extractor: Readability Classification.

pdf-pdftotext-poppler

5
from vamseeachanta/workspace-hub

Sub-skill of pdf: pdftotext (Poppler) (+2).

data-context-extractor

5
from vamseeachanta/workspace-hub

Generate or improve a company-specific data analysis skill by extracting tribal knowledge from analysts

pretext

5
from vamseeachanta/workspace-hub

Use when building creative browser demos with @chenglou/pretext — DOM-free text layout for ASCII art, typographic flow around obstacles, text-as-geometry games, kinetic typography, and text-powered generative art. Produces single-file HTML demos by default.

skill-chain-context-optimization

5
from vamseeachanta/workspace-hub

Refactor large or frequently-run skills into context-efficient chains using isolated execution, file-backed handoffs, minimal summaries, and runtime-aware command substitution.

core-context-management-windows-task-scheduler

5
from vamseeachanta/workspace-hub

Sub-skill of core-context-management: Windows Task Scheduler (+2).

core-context-management-validatecontextsh

5
from vamseeachanta/workspace-hub

Sub-skill of core-context-management: validate_context.sh (+4).

core-context-management-size-limits-mandatory

5
from vamseeachanta/workspace-hub

Sub-skill of core-context-management: Size Limits (MANDATORY) (+3).