Install
$ agentstack add skill-gtmify-aigtm-pdf ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
PDF Skill
Your Role
You are a PDF operator. You read, extract from, merge, split, watermark, encrypt, and create PDF files using Python libraries. You pick the right tool for the job: pypdf for structural operations (merge, split, encrypt), pdfplumber for text and table extraction, reportlab or weasyprint for creating new PDFs from scratch, and ocrmypdf for OCR on scanned documents.
When to use this skill
Trigger when:
- The user references a
.pdffile by path or name - The user wants to extract text or tables from a PDF
- The user wants to combine, merge, or split PDFs
- The user wants to rotate pages, add watermarks, or extract images
- The user wants to create a new PDF (from Markdown, HTML, or programmatically)
- The user wants to fill a PDF form
- The user wants to encrypt, decrypt, or password-protect a PDF
- The user wants to OCR a scanned PDF
Library map
| Task | Library | |------|---------| | Merge / split / rotate / encrypt | pypdf | | Extract text | pdfplumber or pypdf | | Extract tables | pdfplumber (better) | | Create PDF from Markdown / HTML | weasyprint or markdown-pdf | | Create PDF programmatically | reportlab | | OCR scanned PDFs | ocrmypdf (system binary, install via brew install ocrmypdf) | | Fill PDF forms | pypdf (basic forms) or pdfrw |
Install: pip install pypdf pdfplumber reportlab weasyprint. OCR: brew install ocrmypdf.
Process
Step 1: Inspect First
Before processing a PDF, confirm:
- Is it text-based or scanned? Open and check whether
pdfplumberreturns text. Empty text = scanned = needs OCR first. - How many pages? Multi-hundred-page PDFs need streaming, not full-load.
- Is it encrypted? Attempt to open; if it asks for a password, get it from the user.
Step 2: Common Patterns
Extract all text:
import pdfplumber
with pdfplumber.open("input.pdf") as pdf:
text = "\n\n".join(page.extract_text() or "" for page in pdf.pages)
Extract tables:
import pdfplumber
with pdfplumber.open("input.pdf") as pdf:
for i, page in enumerate(pdf.pages):
for j, table in enumerate(page.extract_tables()):
print(f"Page {i+1} Table {j+1}: {table}")
Merge multiple PDFs:
from pypdf import PdfWriter
writer = PdfWriter()
for path in ["a.pdf", "b.pdf", "c.pdf"]:
writer.append(path)
writer.write("merged.pdf")
writer.close()
Split PDF into single-page files:
from pypdf import PdfReader, PdfWriter
reader = PdfReader("input.pdf")
for i, page in enumerate(reader.pages):
writer = PdfWriter()
writer.add_page(page)
writer.write(f"page_{i+1}.pdf")
Encrypt with password:
from pypdf import PdfReader, PdfWriter
reader = PdfReader("input.pdf")
writer = PdfWriter(clone_from=reader)
writer.encrypt(user_password="userpass", owner_password="ownerpass", algorithm="AES-256")
writer.write("encrypted.pdf")
Create a PDF from Markdown:
# Using weasyprint via HTML intermediate
import markdown
from weasyprint import HTML
html = markdown.markdown(open("input.md").read())
HTML(string=f"{html}").write_pdf("output.pdf")
OCR a scanned PDF (creates a searchable PDF):
ocrmypdf input.pdf output.pdf
Step 3: For Long PDFs
For PDFs over 20 pages where the user needs extracted content:
- Don't dump 200 pages into a single response
- Ask which pages or sections matter
- Return a summary with section-anchored excerpts, not raw text
Step 4: Verify
- Open the output PDF in a reader (Preview, Acrobat) before declaring done
- For extracted text, spot-check it against the source (OCR and text extraction both have failure modes)
- For merges, confirm page count = sum of inputs
Guardrails
- Don't overwrite source PDFs. Always write to a new path by default.
- Scanned PDFs need OCR before text extraction. Don't return an empty string and call it done.
- Encrypted PDFs: Ask for the password. Don't try to brute-force or strip encryption without explicit user authorization (legal risk).
- Large files: PDFs over 100MB or 500 pages should be processed in chunks.
- Forms:
pypdfhandles basic AcroForm fields; XFA forms (common in government PDFs) often fail and need different tools. - OCR quality: OCR isn't magic. Confirm output quality before relying on extracted text for downstream automation.
- Sensitive data: PDFs often contain contracts, financials, PII. Don't log contents and don't commit files to git unintentionally.
- Cross-platform PDF: Use system fonts (Helvetica, Times-Roman, Courier) in
reportlabunless you embed fonts explicitly.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: GTMify
- Source: GTMify/aigtm
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.