Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

qpdf

$ qpdf Community Low Risk
QPDF · AI & Media · Apache-2.0 · macos / linux / windows

QPDF inspects, validates (--check), splits (--pages), linearizes (--linearize), encrypts, and decrypts (--decrypt) PDF files without altering page content streams. With native --json v2 export and --json-input reconstruction, it is uniquely machine-readable among PDF tools.

FCRS-1.0 Score
90 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install qpdf
CLI vs MCP Decision CLI Only

Structural PDF validation, --json object inspection, and lossless page splitting execute locally at native speed with zero MCP overhead.

Agent-Readiness Checklist

✓ JSON Output
✓ Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 23 / 25

Standout --json (with --json-key filtering), --json-input, predictable exit codes (0 ok, 2 error, 3 warnings), and strictly non-interactive execution.

  • Native --json and --json-key flags emit clean machine-readable PDF structure
  • Never prompts interactively on TTY
Trust & Safety 22 / 25

Preserves content streams losslessly and requires explicit --replace-input to overwrite source files, though --decrypt can strip restrictions if authorized.

  • Requires explicit --replace-input for in-place mutation
  • Supports --check read-only structural validation
Setup & Portability 14 / 15

Fast C++ binary distributed via Homebrew, all major Linux package managers, and Windows releases.

  • Available via brew install qpdf and official GitHub releases
Utility & Efficiency 14 / 15

Handles inspection, merging, splitting, linearization, encryption, and JSON round-tripping in one deterministic binary.

  • Supports --pages, --linearize, --decrypt, and --json
Maintenance & Lineage 9 / 10

Actively maintained Apache-2.0 project (qpdf/qpdf) with decades of production PDF engineering.

  • Official qpdf/qpdf GitHub repository under Apache-2.0
Docs & Verifiability 8 / 10

Thorough ReadTheDocs manual and structured --help output covering every option and exit code.

  • Detailed CLI reference at qpdf.readthedocs.io

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; optional --password= or --password-file= reads local PDF decryption passwords.

Side Effects
Read-Only Local Write
Cost & Quotas

Free Apache-2.0 open-source C++ binary.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# QPDF Agent Rules
- Run `qpdf --check` or `qpdf --json` before transforming unfamiliar PDFs.
- Always write to a distinct output path instead of `--replace-input` unless overwrite is explicitly requested.
- Pass `--warning-exit-0` only when you intentionally accept non-fatal PDF warnings.

Agent-Ready Command Recipes

Safe Read-Only Queries

Inspect PDF structure and metadata as JSON
qpdf --json input.pdf

Emits the complete PDF object graph, page count, and encryption status in structured JSON.

Validate PDF structural integrity
qpdf --check input.pdf

Verifies xref tables, stream lengths, and linearization without modifying the file.

Controlled Writes & Previews

Extract a page range and linearize for web
qpdf --linearize input.pdf --pages . 1-5 -- subset.pdf

Writes pages 1–5 to a new web-optimized subset.pdf without touching input.pdf.

Strengths for Agents

  • + Native --json and --json-key inspection eliminates fragile text scraping of PDF structure.
  • + Distinct exit code 3 for warnings vs 2 for errors lets scripts handle repaired PDFs cleanly.

Caveats & Pitfalls

  • ! Exit code 3 (warnings) causes naive set -e shell wrappers to abort unless --warning-exit-0 is passed.
  • ! Only transforms PDF structure and objects; does not rasterize pages or extract plain text.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI