document-pdf
Skill94 starsChanged 33 days agoMITView on GitHub
Handles PDF/UA accessibility, real redaction, metadata scrubbing, signing, and extraction. Use when redacting or signing PDFs; for plain create/merge prefer the official pdf skill.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- itgenius-au/skills-librarytheir own version, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- itgenius-au/skills-library★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository146 other files it gives its agents.
- agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- hooks/AGENTS.mdAGENTS.md
- agents-hooksSkill
- agents-mcpSkill
- agents-memorySkill
- agents-skills-feedback-loopSkill
- agents-skillsSkill
- agents-subagentsSkill
- agents-swarm-orchestrationSkill
- ai-agentsSkill
- ai-architecture-advisorSkill
- ai-bot-builderSkill
- ai-coding-agents-observability-evalsSkill
- ai-coding-agents-pluginsSkill
- ai-coding-agents-provider-runtimeSkill
- ai-coding-agents-runtime-coreSkill
- ai-coding-agents-safety-envelopeSkill
- ai-coding-agents-settings-policySkill
- ai-coding-agentsSkill
- ai-coding-agents-stateSkill
- ai-coding-agents-surfacesSkill
- ai-context-layerSkill
- ai-data-curation-pretrainingSkill
- ai-deep-researchSkill
- ai-distributed-trainingSkill
- ai-evalsSkill
- ai-llm-inferenceSkill
- ai-llmSkill
- ai-local-model-opsSkill
- ai-ml-data-scienceSkill
- ai-mlopsSkill
- ai-ml-timeseriesSkill
- ai-post-trainingSkill
- ai-pretrainingSkill
- ai-product-operating-modelSkill
- ai-prompt-engineeringSkill
- ai-ragSkill
- ai-scaling-lawsSkill
- ai-vector-brainSkill
- ai-voice-botsSkill
- data-analytics-engineeringSkill
- data-lake-platformSkill
- data-metabaseSkill
- data-sql-optimizationSkill
- data-streamingSkill
- dev-ai-coding-metricsSkill
- dev-api-designSkill
- dev-context-code-graphSkill
- dev-context-engineeringSkill
- dev-context-multi-repoSkill
- dev-contribution-quality-analysisSkill
- dev-dependency-managementSkill
- dev-git-commit-messageSkill
- dev-git-workflowSkill
- dev-workflow-planningSkill
- docs-ai-prdSkill
- docs-codebaseSkill
- docs-notes-retrievalSkill
- document-docxSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
If the user needs accessibility/compliance, prefer generating from a source format that supports structure (DOCX/HTML + proper export) …
- Very specific: line 22
Never treat black rectangles or overlays as redaction.
- Very specific: line 55
Create: use Playwright for browser-faithful HTML/CSS, WeasyPrint for semantic/tagged HTML exports, ReportLab for Python-heavy layouts, or …
- Very specific: line 80
Keep a versioned source document (doc/slide/design file) alongside the PDF.
- Distinctive: line 81
Verify links and reading order for long documents.
- Distinctive: line 82
Use real redaction and test by copy/paste.
- Very specific: line 83
Use OCRmyPDF for scanned PDFs before text extraction.
- Very specific: line 85
Verify with exiftool -all -G1 after scrubbing — check for residual usernames, paths, tool stamps, and dates you did not intend to publish.
- Very specific: line 134
When prior decisions or pitfalls are relevant, consult learnings.consolidated.md if present.
- Very specific: line 136
After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Document PDF Skill — Quick Reference
Boundary: when the official Anthropic pdf skill is available, prefer it for plain create, merge/split, form fill, and CLI (qpdf/pdftotext) work. Use this skill for its unique lanes: accessibility (PDF/UA-1/UA-2, EAA), real redaction and its evidence gate, metadata scrubbing, pyHanko signing, OCR/table extraction discipline, and PyMuPDF/pdf-lib licensing and maintenance risk.
- EU compliance: scope the product/service and national implementation before applying the EAA to a PDF. Verify that any cited harmonised standard supports the specific applicable legislation in the Official Journal; an EN 301 549 citation under another directive is insufficient. Load references/pdf-accessibility-compliance.md for that scoping step.
- Metadata exists in multiple layers: PDF Info/XMP, filesystem dates, and OS extended attributes. Scrubbing one layer leaves the others available.
Core Decision Rules
- 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. Real redaction removes the content bytes: PyMuPDF
page.add_redact_annot(rect)thenpage.apply_redactions()per page, then save. Prove it with the redaction evidence gate. - Password protection: pypdf
writer.encrypt(..., algorithm='AES-256')(security handler R6). Omittingalgorithmwrites RC4-128, so always pass it; useAES-256-R5only for a named legacy reader. Permission flags are advisory, not security. See references/pdf-security-redaction.md. - Table extraction is probabilistic, not deterministic: run
pdfplumberfirst and spot-check output against the source page; escalate toCamelotonly when columns/rows are visibly wrong, and always inspect Camelot's per-tableaccuracyscore rather than trusting output blindly. PyMuPDF/fitz(used byscrub_metadata.pyand 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 substitutepypdf/pdfplumberwhere the required functionality overlaps.pdf-lib(Node): check the upstream package's release activity before depending on it. If it is stale and you need ongoing fixes, evaluate a maintained fork before committing, and pin the dependency either way.
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 |
| Edit PDF | pdf-lib | Node.js | Modify existing PDFs, add pages (check upstream release activity first) |
| Parse/merge/split/rotate | pypdf | Python | Deterministic PDF manipulation |
| Extract text | pdfplumber | Python | OCR-free text extraction |
| OCR scanned PDF | OCRmyPDF | Python/CLI | Searchable text layer for scanned PDFs |
| Custom OCR pipeline | PyMuPDF (fitz) + Tesseract | Python | Page-level OCR or image-heavy extraction — PyMuPDF is AGPL-3.0/commercial dual-licensed |
| Extract tables | pdfplumber | Python | Default table extraction; verify visually before trusting |
| Extract hard tables | Camelot (camelot-py) | Python | Lattice/stream edge cases; check the installed release's backends and inspect table.accuracy either way |
| Fill forms | pypdf (update_page_form_field_values) / pdf-lib | Python / Node.js | Form automation; see references/pdf-forms-interactive.md |
| Sign PDFs | pyHanko | Python/CLI | Digital signatures and validation |
| HTML to PDF | Playwright | Node.js | Browser-faithful web page rendering |
| HTML to tagged PDF | WeasyPrint | Python | Semantic HTML, PDF/A or PDF/UA-oriented export |
| Validate PDF/A | veraPDF | CLI/GUI | Archival conformance checks |
| Validate PDF accessibility | veraPDF (PDF/UA-1, PDF/UA-2 profiles) + PAC / Acrobat Checker | CLI/GUI | Machine-checkable PDF/UA rules in CI, then manual checks |
| Inspect/edit file metadata | exiftool | CLI | Audit or rewrite internal dates, XMP, EXIF, ICC across PDF/image files |
| Normalise filesystem dates | touch / SetFile | CLI (macOS) | Set timestamps to the release/build date; never backdate records |
Default Workflow
- Create: use
Playwrightfor browser-faithful HTML/CSS,WeasyPrintfor semantic/tagged HTML exports,ReportLabfor Python-heavy layouts, orpdfkitfor Node-first custom layout. - Extract: first classify the file as born-digital vs scanned; run
OCRmyPDFbefore downstream extraction on scanned PDFs, then usereferences/pdf-extraction-patterns.md. - Ship: run
assets/pdf-release-checklist.md; addPAC/ Acrobat checks for accessibility-sensitive PDFs andveraPDFwhen archival conformance matters.
Scripts And Exit Codes
Each script needs Python 3 plus the dependency named in its --help.
python3 scripts/merge_pdfs.py merged.pdf a.pdf b.pdf
python3 scripts/split_pdf.py in.pdf out_dir --each-page
python3 scripts/rotate_pdf.py in.pdf out.pdf --degrees 90
python3 scripts/scrub_metadata.py in.pdf out.pdf
python3 scripts/scrub_metadata.py in.pdf out.pdf --filesystem-date <publication-date> --strip-xattrs
python3 scripts/test_scrub_metadata.py- Input errors exit nonzero; argparse usage errors exit 2.
scrub_metadata.pyexits 1 on scrub or requested filesystem-operation failure, with an error on stderr. It stages output beside the destination and replaces it only after all requested operations succeed, preserving an existing destination on failure. Input and output must differ. On macOS--strip-xattrsclears all output attributes usingxattr;--filesystem-datealso requiresSetFilefor creation time. Other platforms support access/modification times only and reject--strip-xattrs. scrub_metadata.pyremoves Info/XMP metadata, attachments, JavaScript and thumbnails, and keeps OCR text layers and links by default. PyMuPDF's ownscrub()deletes both; the script does so only with--remove-hidden-text/--remove-links. Stripping the OCR layer makes a scanned PDF unsearchable and inaccessible.--strip-xattrschecks for residual attributes after clearing them. macOS may retain protected provenance attributes despite command success; the helper then rejects publication. Resolve the applicable host policy and verify the released file separately instead of assuming all traces were removed.
Do / Avoid
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
OCRmyPDFfor scanned PDFs before text extraction. - Scrub all metadata layers before distribution (PDF-internal, filesystem dates, macOS xattrs).
- Verify with
exiftool -all -G1after scrubbing — check for residual usernames, paths, tool stamps, and dates you did not intend to publish. - 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
wkhtmltopdfin new 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.
- Backdating file or metadata dates to misrepresent when a record was created (falsification); normalise to the real publication date instead.
- Trusting
Camelot/pdfplumbertable 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.
For export QA, render every page with pdftoppm -png -r 80 out.pdf page (Poppler) and inspect the page-*.png files alongside assets/pdf-release-checklist.md.
Redaction Evidence Gate
Prove redaction against every representation that can disclose the value: extracted text, search results, copy/paste, page rendering, annotations, form fields, attachments, and metadata. Reopen the final saved file in a second parser or viewer and search for the sensitive tokens plus normalized variants; inspect the redacted region at high zoom to catch overlays, shifted text, and partial glyphs. Record the token set or synthetic stand-ins used for verification without reproducing sensitive values in logs. If OCR was involved, test both the visible image and hidden text layer. A black box, empty search result in one viewer, or metadata scrub alone is not sufficient evidence that content was removed.
Navigation
Resources
- references/pdf-generation-patterns.md — Complex layouts, multi-page docs
- references/pdf-extraction-patterns.md — Text, table, image extraction
- references/extraction-stack.md — Load when picking an extraction tool (native parse vs Docling vs OCR) for a new LLM/RAG pipeline
- references/pdf-accessibility-compliance.md — Tagged PDFs, PDF/UA, EAA compliance
- references/pdf-forms-interactive.md — AcroForms, form filling, digital signatures
- references/pdf-security-redaction.md — Encryption, permissions, real redaction
- data/sources.json — Library documentation links
Scripts
scripts/merge_pdfs.py— Merge PDFs in orderscripts/split_pdf.py— Split one-per-page or by rangescripts/rotate_pdf.py— Rotate all pages by 90/180/270 degreesscripts/scrub_metadata.py— Scrub Info/XMP metadata, attachments, JavaScript, and thumbnails (keeps OCR text and links by default)
Templates
- assets/invoice-template.md — Invoice PDF generation
- assets/report-template.md — Multi-page report structure
- assets/pdf-release-checklist.md — Links, accessibility, export fidelity
Related Skills
- ../document-docx/SKILL.md — Word document generation
- ../document-xlsx/SKILL.md — Excel/spreadsheet workflows
- ../document-pptx/SKILL.md — PowerPoint presentations
Learnings Loop
When prior decisions or pitfalls are relevant, consult learnings.consolidated.md if present; use learnings.md only for needed history or as the available fallback. Otherwise skip both.
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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

