document-pdf

Extract text/tables from PDFs, create formatted PDFs, merge/split/rotate, and handle forms. Use for any PDF generation or parsing task.

INSTALLATION
npx skills add https://github.com/vasilyu1983/ai-agents-public --skill document-pdf
Run in your project or agent environment. Adjust flags if your CLI version differs.

SKILL.md

$27

Quick Reference

Task

Tool/Library

Language

When to Use

Create PDF

pdfkit

Node.js

Reports, invoices, certificates

Create PDF

ReportLab

Python

Complex layouts, tables

Create PDF

FPDF2

Python

Simple PDFs with Unicode support

Create PDF

Borb

Python

Interactive elements, pure Python

Edit PDF

pdf-lib

Node.js

Modify existing PDFs, add pages

Extract text

pdfplumber

Python

OCR-free text extraction

OCR scanned PDF

PyMuPDF + Tesseract

Python

Scanned PDFs (no selectable text)

Extract tables

Camelot

Python

Tables with borders (Lattice mode)

Extract tables

Camelot/Tabula

Python

Tables without borders (Stream mode)

Parse/merge/split/rotate

pypdf

Python

Deterministic PDF manipulation

Fill forms

pdf-lib

Node.js

Form automation

HTML to PDF

Puppeteer/Playwright

Node.js

High-fidelity web page rendering

HTML to PDF

WeasyPrint

Python

CSS3-based, no browser needed

When to Use This Skill

Claude should invoke this skill when a user requests:

  • Generate PDFs from data (invoices, reports, certificates)
  • Extract text or tables from existing PDFs
  • Merge multiple PDFs into one document
  • Split PDFs into separate files
  • Fill PDF forms programmatically
  • Add watermarks, headers, footers
  • Convert HTML/web pages to PDF

Default Workflow

  • Create: pick pdfkit (Node) or ReportLab (Python) and start from assets/invoice-template.md or assets/report-template.md; for advanced layouts use references/pdf-generation-patterns.md.
  • Extract: use references/pdf-extraction-patterns.md (text/tables/images/metadata + OCR fallback).
  • Ship: run assets/pdf-release-checklist.md (fidelity, links, accessibility baseline, privacy).

Scripts (Deterministic Operations)

Scripts are optional helpers; they assume Python 3 plus the listed dependencies in each file.

  • Merge: python3 scripts/merge_pdfs.py merged.pdf a.pdf b.pdf
  • Split: python3 scripts/split_pdf.py in.pdf out_dir --each-page
  • Rotate: python3 scripts/rotate_pdf.py in.pdf out.pdf --degrees 90
  • Scrub metadata: python3 scripts/scrub_metadata.py in.pdf out.pdf

PDF Structure Patterns

Invoice Template

INVOICE STRUCTURE

├── Header (logo, company info, invoice #)

├── Bill To / Ship To blocks

├── Line items table

│   ├── Description | Qty | Unit Price | Total

│   └── Subtotal, Tax, Total

├── Payment terms

└── Footer (contact, thank you)

Report Template

REPORT PDF STRUCTURE

├── Cover page (title, author, date)

├── Table of contents

├── Body sections with page numbers

├── Charts/images with captions

├── Appendices

└── Running header/footer

Decision Tree

PDF Task: [What do you need?]

    ├─ Create new PDF?

    │   ├─ Simple text/tables → pdfkit (Node) or ReportLab (Python)

    │   ├─ Complex layouts → ReportLab with Platypus

    │   └─ From HTML → Puppeteer or wkhtmltopdf

    │

    ├─ Extract from PDF?

    │   ├─ Text only → pdfplumber (Python)

    │   ├─ Tables → pdfplumber or camelot (Python)

    │   └─ Images → PyMuPDF/fitz (Python)

    │

    ├─ Modify existing PDF?

    │   ├─ Add text/images → pdf-lib (Node)

    │   ├─ Merge/split → pypdf or pdf-lib

    │   └─ Fill forms → pdf-lib

    │

    └─ Batch processing?

        └─ pypdf + pdfplumber pipeline

Do / Avoid (Jan 2026)

Do

  • Keep a versioned source document (doc/slide/design file) alongside the PDF.
  • Verify links and reading order for long documents.
  • Use real redaction and test by copy/paste.

Avoid

  • Editing PDFs as the primary workflow when a source doc exists.
  • Shipping PDFs with broken links or illegible charts.
  • Including customer PII or secrets in PDFs without explicit approval.

What Good Looks Like

  • Fidelity: export is reproducible from a versioned source file (doc/slide/design) and looks identical across viewers.
  • Accessibility: tags/reading order are correct; links work; scanned docs are OCRed when appropriate.
  • Release hygiene: file naming includes version/date; metadata is clean; no “PDF as source of truth”.
  • Security: redaction is verified (copy/paste test) and sensitive data is minimized.
  • QA: release checklist completed using assets/pdf-release-checklist.md.

Optional: AI / Automation

Use only when explicitly requested and policy-compliant.

  • Generate a release checklist run; humans verify the final PDF manually.

Navigation

Resources

Templates

Related Skills

Fact-Checking

  • Use web search/web fetch to verify current external facts, versions, pricing, deadlines, regulations, or platform behavior before final answers.
  • Prefer primary sources; report source links and dates for volatile information.
  • If web access is unavailable, state the limitation and mark guidance as unverified.
BrowserAct

Let your agent run on any real-world website

Bypass CAPTCHA & anti-bot for free. Start local, scale to cloud.

Explore BrowserAct Skills →

Stop writing automation&scrapers

Install the CLI. Run your first Skill in 30 seconds. Scale when you're ready.

Start free
free · no credit card