
Pdf Generator
Programmatically create, fill, merge, watermark, and extract content from PDFs as build-phase document deliverables.
Overview
pdf-generator is an agent skill for the Build phase that creates, fills, merges, and extracts PDF documents programmatically with Deno.
Install
npx skills add https://github.com/jwynia/agent-skills --skill pdf-generatorWhat is this skill?
- Template mode: fill text, checkbox, and dropdown fields on existing PDFs
- Scratch mode: build PDFs from JSON specifications
- Merge multiple PDFs, add watermarks/overlays, and extract text or metadata
- Runs on Deno with explicit --allow-read and --allow-write permissions
- Explicit limits: no OCR, weak support for password-protected PDFs, not for complex flowing layout
- MIT license
- metadata version 1.0
- two operation modes: template and scratch
Adoption & trust: 865 installs on skills.sh; 92 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have structured data or an existing PDF template but no reliable way for your agent to produce a final PDF file on disk.
Who is it for?
Solo builders automating invoices, reports, compliance forms, or packet merges from agent-driven data or JSON specs.
Skip if: Opening PDFs in a viewer, OCR on scanned pages, password-locked PDFs, or magazine-style flowing layouts (use HTML-to-PDF or dedicated layout tools).
When should I use this skill?
User needs to generate PDFs, fill PDF forms, extract PDF content, add watermarks/overlays, or merge documents programmatically.
What do I get? / Deliverables
You get generated or modified PDF files—filled forms, merged packets, or extracted text—ready to attach, email, or store in your repo.
- Generated or modified PDF files on disk
- Merged multi-document PDFs
- Extracted text or structural metadata from source PDFs
Recommended Skills
Journey fit
How it compares
Use as a programmatic PDF toolkit in the repo—not a hosted document editor or browser-only PDF viewer.
Common Questions / FAQ
Who is pdf-generator for?
Indie developers and small teams who ship PDF reports, forms, or merged documents from Claude Code, Cursor, or Codex and want Deno scripts the agent can run locally.
When should I use pdf-generator?
Use it in the Build phase (docs) when you must generate PDFs from data, fill PDF forms, merge files, add watermarks, or extract text—after you have Deno and your template or JSON spec ready.
Is pdf-generator safe to install?
It needs filesystem read/write and Deno execution; review the Security Audits panel on this Prism page and only point it at trusted PDF paths and specs.
SKILL.md
READMESKILL.md - Pdf Generator
# PDF Generator ## When to Use This Skill Use this skill when: - Creating PDF documents programmatically from data or specifications - Filling PDF forms with dynamic data - Adding watermarks, stamps, or overlays to existing PDFs - Extracting text and metadata from PDF files - Merging multiple PDFs into one document - Analyzing PDF structure and form fields Do NOT use this skill when: - User wants to open/view PDFs (use native PDF viewer) - Complex page layout with flowing text is needed (consider HTML-to-PDF tools) - Working with password-protected PDFs (limited support) - OCR is needed for scanned documents ## Prerequisites - Deno installed (https://deno.land/) - Input PDF files for template-based operations - JSON specification for scratch generation ## Quick Start ### Two Modes of Operation 1. **Template Mode**: Modify existing PDF templates - Fill form fields (text, checkbox, dropdown) - Add overlays (text, images, shapes) - Merge and combine PDFs 2. **Scratch Mode**: Create PDFs from nothing using JSON specifications ## Instructions ### Mode 1: Template-Based Generation #### Step 1a: Analyze the Template Extract form fields and structure from an existing PDF: ```bash deno run --allow-read scripts/analyze-template.ts form-template.pdf > inventory.json ``` **Output** (inventory.json): ```json { "filename": "form-template.pdf", "pageCount": 2, "title": "Application Form", "author": "Company Inc", "pages": [ { "pageNumber": 1, "width": 612, "height": 792, "text": "..." } ], "formFields": [ { "name": "FullName", "type": "text", "value": "" }, { "name": "Email", "type": "text", "value": "" }, { "name": "AgreeToTerms", "type": "checkbox", "value": false } ], "placeholders": [ { "tag": "{{DATE}}", "location": "page 1", "pageNumber": 1 } ], "hasFormFields": true } ``` #### Step 1b: Create Fill Specification Create `form-data.json`: ```json { "formFields": [ { "name": "FullName", "value": "John Smith" }, { "name": "Email", "value": "john@example.com" }, { "name": "AgreeToTerms", "value": true } ], "flattenForm": true } ``` #### Step 1c: Generate Filled PDF ```bash deno run --allow-read --allow-write scripts/generate-from-template.ts \ form-template.pdf form-data.json filled-form.pdf ``` ### Adding Overlays (Watermarks, Stamps) Create `watermark-spec.json`: ```json { "overlays": [ { "type": "text", "page": 1, "x": 200, "y": 400, "text": "CONFIDENTIAL", "fontSize": 48, "color": { "r": 1, "g": 0, "b": 0 }, "rotate": 45 }, { "type": "image", "page": 1, "x": 450, "y": 700, "path": "logo.png", "width": 100, "height": 50 } ] } ``` ### Merging PDFs Create `merge-spec.json`: ```json { "prependPdfs": [ { "path": "cover-page.pdf" } ], "appendPdfs": [ { "path": "appendix-a.pdf", "pages": [1, 2, 3] }, { "path": "appendix-b.pdf" } ], "excludePages": [5, 6] } ``` ### Mode 2: From-Scratch Generation #### Step 2a: Create Specification Create `spec.json`: ```json { "title": "Quarterly Report", "author": "Finance Team", "pages": [ { "size": "A4", "elements": [ { "type": "text", "x": 50, "y": 750, "text": "Q4 2024 Financial Report", "fontSize": 28, "font": "Helvet