Skip to content
Back to skills

Pdftotext Poppler

ASecurity

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

  • 17 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
developmentpythongobashperformance

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill pdftotext-poppler --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pdftotext Poppler?

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

Security grade badge for Pdftotext Poppler
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-pdftotext-poppler/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-pdftotext-poppler)

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-pdftotext-poppler
description: 'Sub-skill of pdf: pdftotext (Poppler) (+2).'
version: 1.2.2
category: data
type: reference
scripts_exempt: true
---

# pdftotext (Poppler) (+2)

## pdftotext (Poppler)

**Preferred tool for batch PDF text extraction** (WRK-1277 finding).

```bash
# Single file
pdftotext document.pdf output.txt
pdftotext -layout document.pdf output.txt  # Preserve layout
```

### Batch Processing Pattern (Proven at 297K scale)

Use `subprocess.run(timeout=N)` for reliable timeout handling in parallel workers:

```python
import subprocess
from concurrent.futures import ProcessPoolExecutor

def extract_text(pdf_path: str, timeout: int = 30) -> str | None:
    """Extract text via pdftotext subprocess — killable on timeout."""
    try:
        result = subprocess.run(
            ["pdftotext", pdf_path, "-"],
            capture_output=True, text=True, timeout=timeout
        )
        return result.stdout if result.returncode == 0 else None
    except subprocess.TimeoutExpired:
        return None  # Process killed cleanly by OS

# 8 workers, chunksize=50 — sustained ~49 files/second
with ProcessPoolExecutor(max_workers=8) as pool:
    results = list(pool.map(extract_text, pdf_paths, chunksize=50))
```

> **Why subprocess, not pdfplumber?** pdfplumber runs in-process and can enter kernel
> D-state (uninterruptible disk sleep) on NTFS/NFS mounts. SIGALRM cannot interrupt
> kernel I/O — the process hangs forever. `subprocess.run(timeout=N)` runs pdftotext
> in a separate process that the OS can kill reliably via SIGTERM.

### Performance (WRK-1277 Benchmarks)

| Metric | pdftotext (subprocess) | pdfplumber (in-process) |
|--------|----------------------|------------------------|
| Speed | ~49 files/sec (8 workers) | ~1.3 files/sec |
| Timeout reliability | Reliable (OS-level kill) | Unreliable (D-state hangs) |
| NFS/NTFS safety | Safe (subprocess isolation) | Hangs on D-state I/O |
| Multiprocessing | Works with ProcessPoolExecutor | Serialization failures |

## qpdf

```bash
# Merge PDFs
qpdf --empty --pages file1.pdf file2.pdf -- merged.pdf

# Split pages
qpdf document.pdf --pages . 1-5 -- first_five.pdf

# Decrypt
qpdf --decrypt encrypted.pdf decrypted.pdf
```


## pdftk

```bash
# Merge
pdftk file1.pdf file2.pdf cat output merged.pdf

# Split
pdftk document.pdf burst output page_%02d.pdf

# Rotate
pdftk document.pdf cat 1-endeast output rotated.pdf
```

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.

Comments

Loading comments…

Newsletter

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