Document Pdf logo

Document Pdf

Community
vasilyu1983
document-pdf

Extracts, creates, and transforms PDF documents. Use when parsing text or tables, generating files, merging pages, or handling PDF forms.

Overview

Publishervasilyu1983
RepositoryAI-Agents-public
Skill namedocument-pdf
Stars
87
Forks
19
Bundled files
17
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 17 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by vasilyu1983 on GitHub. Read the source before you install it.

Installation

Install the Document Pdf AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/vasilyu1983/AI-Agents-public.git /tmp/AI-Agents-public
mkdir -p .claude/skills
cp -r /tmp/AI-Agents-public/frameworks/shared-skills/skills/document-pdf .claude/skills/document-pdf
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Document Pdf in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Document Pdf on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Document Pdf is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Document PDF Skill — Quick Reference

This skill enables PDF creation, extraction, manipulation, and analysis. Apply these patterns when users need to generate invoices, reports, extract data from PDFs, merge documents, or work with PDF forms.

Modern Best Practices (Jul 2026):

  • PDF is a release artifact, not the editable source of truth.
  • Validate export fidelity (fonts, images, links) and accessibility where required.
  • Accessibility: if compliance matters, target a tagged/structured PDF workflow (often PDF/UA-aligned) and validate with tooling.
  • EU distribution: EAA (June 2025) typically implies EN 301 549 expectations for customer-facing PDFs.
  • Treat PDFs as sensitive: scrub metadata at all layers (PDF-internal, filesystem, OS xattrs), ensure real redaction, and control distribution.
  • Metadata exists in multiple layers: PDF Info/XMP (internal), filesystem dates (OS), and extended attributes (macOS quarantine, provenance). Scrubbing one layer while ignoring others leaves traces.

Core Decision Rules (2026)

  • First decide: born-digital PDF (selectable text) vs scanned PDF (images). Scanned PDFs usually require OCR; see references/pdf-extraction-patterns.md.
  • If the user needs accessibility/compliance, prefer generating from a source format that supports structure (DOCX/HTML + proper export) rather than “post-fixing” an untagged PDF.
  • For deterministic ops (merge/split/rotate/scrub), prefer scripts/ helpers over re-implementing ad hoc.
  • Never treat black rectangles or overlays as redaction; use real redaction and verify by copy/paste + search.
  • Table extraction is probabilistic, not deterministic: run pdfplumber first and spot-check output against the source page; escalate to Camelot only when columns/rows are visibly wrong, and always inspect Camelot's per-table accuracy score rather than trusting output blindly.
  • PyMuPDF/fitz (used by scrub_metadata.py and most redaction/OCR-prep code below) is dual-licensed AGPL-3.0 / commercial. Flag this before shipping it inside a closed-source product or SaaS backend — AGPL's network-use clause can trigger a source-disclosure obligation; get a commercial license from Artifex or substitute pypdf/pdfplumber where the required functionality overlaps.
  • pdf-lib (Node) has had no active upstream releases for an extended period as of mid-2026; for new Node projects needing ongoing fixes, evaluate a maintained fork (e.g. @cantoo/pdf-lib) before committing, and pin the dependency either way.

Quick Reference

TaskTool/LibraryLanguageWhen to Use
Create PDFpdfkitNode.jsReports, invoices, certificates
Create PDFReportLabPythonComplex layouts, tables
Create PDFFPDF2PythonSimple PDFs with Unicode support
Edit PDFpdf-libNode.jsModify existing PDFs, add pages (upstream low-activity — consider a maintained fork)
Parse/merge/split/rotatepypdfPythonDeterministic PDF manipulation
Extract textpdfplumberPythonOCR-free text extraction
OCR scanned PDFOCRmyPDFPython/CLISearchable text layer for scanned PDFs
Custom OCR pipelinePyMuPDF (fitz) + TesseractPythonPage-level OCR or image-heavy extraction — PyMuPDF is AGPL-3.0/commercial dual-licensed
Extract tablespdfplumberPythonDefault table extraction; verify visually before trusting
Extract hard tablesCamelot (camelot-py)PythonLattice/stream edge cases; 2026 releases add an optional neural backend — check table.accuracy either way
Fill formspdf-libNode.jsForm automation
Sign PDFspyHankoPython/CLIDigital signatures and validation
HTML to PDFPlaywrightNode.jsBrowser-faithful web page rendering
HTML to tagged PDFWeasyPrintPythonSemantic HTML, PDF/A or PDF/UA-oriented export
Validate PDF/AveraPDFCLI/GUIArchival conformance checks
Validate PDF accessibilityPAC / Acrobat CheckerGUIPDF/UA and accessibility checks
Inspect/edit file metadataexiftoolCLIAudit or rewrite internal dates, XMP, EXIF, ICC across PDF/image files
Set filesystem datestouch / SetFileCLI (macOS)Correct creation/modification timestamps at OS level

When to Use This Skill

Use 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: use Playwright for browser-faithful HTML/CSS, WeasyPrint for semantic/tagged HTML exports, ReportLab for Python-heavy layouts, or pdfkit for Node-first custom layout.
  • Extract: first classify the file as born-digital vs scanned; run OCRmyPDF before downstream extraction on scanned PDFs, then use references/pdf-extraction-patterns.md.
  • Ship: run assets/pdf-release-checklist.md; add PAC / Acrobat checks for accessibility-sensitive PDFs and veraPDF when archival conformance matters.

ASCII Flow

text
PDF request
  |
  v
Classify task
  |-- create new PDF
  |-- extract text / tables / images
  |-- modify existing PDF
  |-- fill / sign forms
  |-- merge / split / rotate / scrub
  |
  v
Classify source and risk
  |-- born-digital ----> extract directly
  |-- scanned ---------> OCR first
  |-- sensitive -------> real redaction + metadata scrub
  |-- compliance ------> tagged / structured source workflow
  |
  v
Select tool or script
  |-- HTML/CSS --------> Playwright or WeasyPrint
  |-- Python layout ---> ReportLab / FPDF2
  |-- deterministic ---> scripts/ + pypdf
  |-- extraction ------> pdfplumber / OCRmyPDF / Camelot
  |
  v
Verify fidelity, accessibility, metadata, and redaction

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 and active content: python3 scripts/scrub_metadata.py in.pdf out.pdf
  • Scrub with filesystem + xattr cleanup: python3 scripts/scrub_metadata.py in.pdf out.pdf --filesystem-date 2025-09-20 --strip-xattrs

PDF Structure Patterns

Invoice Template

text
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

text
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

text
PDF Task: [What do you need?]
    ├─ Create new PDF?
    │   ├─ Browser-faithful HTML/CSS → Playwright
    │   ├─ Semantic HTML / tagged export → WeasyPrint
    │   ├─ Node-first custom layout → pdfkit
    │   └─ Python complex layout → ReportLab / FPDF2
    ├─ Extract from PDF?
    │   ├─ Born-digital text → pdfplumber (Python)
    │   ├─ Scanned pages → OCRmyPDF, then pdfplumber
    │   ├─ Tables → pdfplumber first, Camelot for hard cases
    │   └─ Images / raster work → PyMuPDF/fitz
    ├─ Modify existing PDF?
    │   ├─ Add text/images → pdf-lib (Node)
    │   ├─ Merge/split/rotate/scrub → pypdf + scripts
    │   ├─ Fill forms → pdf-lib
    │   └─ Sign → pyHanko
    └─ Batch processing?
        └─ OCRmyPDF / pypdf / pdfplumber pipeline

Do / Avoid (Jul 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.
  • Use OCRmyPDF for scanned PDFs before text extraction.
  • Scrub all metadata layers before distribution (PDF-internal, filesystem dates, macOS xattrs).
  • Verify with exiftool -all -G1 after scrubbing — check for tool fingerprints (XMP Toolkit) and residual dates.
  • Confirm PyMuPDF's AGPL/commercial licensing fits the deployment before relying on it in closed-source or SaaS code paths.

Avoid

  • Editing PDFs as the primary workflow when a source doc exists.
  • Defaulting to wkhtmltopdf in new 2026 workflows.
  • Shipping PDFs with broken links or illegible charts.
  • Including customer PII or secrets in PDFs without explicit approval.
  • Scrubbing only PDF-internal metadata while ignoring filesystem dates and OS-level xattrs.
  • Using exiftool to modify PDF XMP without overwriting its XMP Toolkit fingerprint.
  • Trusting Camelot/pdfplumber table output on financial or legal documents without a visual spot-check or accuracy-score review — misaligned columns fail silently.
  • Bundling PyMuPDF into a proprietary product without checking AGPL obligations or budgeting for a commercial license.

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

Scripts

  • scripts/merge_pdfs.py — Merge PDFs in order
  • scripts/split_pdf.py — Split one-per-page or by range
  • scripts/rotate_pdf.py — Rotate all pages by 90/180/270 degrees
  • scripts/scrub_metadata.py — Scrub Info/XMP metadata, attachments, JavaScript, and thumbnails

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.

Learnings Loop

Before applying this skill on a non-trivial task, read learnings.consolidated.md in this directory (and learnings.md if present).

After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Document Pdf AI skill do?

Extracts, creates, and transforms PDF documents. Use when parsing text or tables, generating files, merging pages, or handling PDF forms.

Why use Document Pdf on TypingMind?

Because you install it once and use it with any model. Document Pdf is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Document Pdf in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/vasilyu1983/AI-Agents-public/tree/main/frameworks/shared-skills/skills/document-pdf. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Document Pdf?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Document Pdf?

As many as you like. As long as a model supports skills, you can use Document Pdf with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Document Pdf AI skill free?

Yes. It is published on GitHub by vasilyu1983 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇