# PDF

Read, create, edit, merge, split, rotate, fill, render, and verify workspace PDF files.

- Repository: https://github.com/OpenBMB/PilotDeck (4947 stars)
- Category: Documents
- License: AGPL-3.0
- Last updated: 2026-10-29
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add OpenBMB/PilotDeck --skill pdf -g -a claude-code -y`
Codex: `npx skills add OpenBMB/PilotDeck --skill pdf -g -a codex -y`
Cursor: `npx skills add OpenBMB/PilotDeck --skill pdf -g -a cursor -y`
Gemini CLI: `npx skills add OpenBMB/PilotDeck --skill pdf -g -a gemini-cli -y`

## Description

Read, create, edit, merge, split, rotate, fill, render, and verify workspace PDF files. Use whenever the requested input or deliverable is a .pdf, including extracting text or tables, inspecting metadata and page geometry, generating a new PDF, rearranging pages, filling AcroForm fields, or checking visual layout. Do not use for Google Drive or browser-only PDF workflows.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# PDF

Work with PDFs through the bundled `pdf.sh` workflow. Treat structure extraction and visual rendering as complementary: parsed text is evidence about content, while rendered pages are the evidence for layout.

## Hard requirements

- Preserve every input PDF. Write edits to a distinct output unless the user explicitly requests replacement.
- Use `pdfplumber` for text, table, image, and coordinate-aware inspection; use `pypdf` for page structure, metadata, page operations, and AcroForms; use ReportLab for new PDFs.
- Inspect an existing PDF before changing it. Render it first when layout, page order, form appearance, or visual fidelity matters.
- Create a new PDF from one executable Python builder. Patch and rerun the same builder rather than accumulating one-off scripts.
- Never assume successful text extraction proves that a PDF looks correct.
- Run `audit`, render every final page with Poppler, and inspect every page PNG at full size before delivery. A montage is only an overview.
- Fix clipped or overlapping content, missing glyphs, broken tables, incorrect page order, bad image crops, inconsistent page sizes, and wrong page numbers before delivery.
- Do not depend on Codex-private runtime paths or install Python packages globally.

## Read the relevant references

- Read [creation.md](references/creation.md) before creating or visually redesigning a PDF.
- Read [structure-and-forms.md](references/structure-and-forms.md) before merging, splitting, rotating, editing metadata, or handling forms.
- Read [qa-checklist.md](references/qa-checklist.md) before delivery.

## Prepare the runtime

Resolve the CLI once:

```bash
SKILL_ROOT={{SKILL_ROOT_SHELL}}
PDF_TOOL="$SKILL_ROOT/scripts/pdf.sh"
bash "$PDF_TOOL" check || bash "$PDF_TOOL" fix
```

The rest: https://github.com/OpenBMB/PilotDeck/blob/HEAD/skills/pdf/SKILL.md
