Skip to main content

This skill may not reflect the latest upstream change

Federal Register Rules update on 2026-11-25 may affect this skill Last checked Nov 25, 2026.

BusinessAI reviewed Jul 21, 2026

pdf-processing-anthropic

Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.

v1.0.01 install

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install legal-skills-pdf-processing-anthropic
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/legal-skills-pdf-processing-anthropic/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed
0Save

Instructions

PDF Processing Guide

Overview

This guide covers essential PDF processing operations using Python libraries and command-line tools. For advanced features, JavaScript libraries, and detailed examples, see REFERENCE.md. If you need to fill out a PDF form, read FORMS.md and follow its instructions.

Quick Start

from pypdf import PdfReader, PdfWriter

# Read a PDF
reader = PdfReader("document.pdf")
print(f"Pages: {len(reader.pages)}")

# Extract text
text = ""
for page in reader.pages:
    text += page.extract_text()

Python Libraries

pypdf - Basic Operations

Merge PDFs

from pypdf import PdfWriter, PdfReader

writer = PdfWriter()
for pdf_file in ["doc1.pdf", "doc2.pdf", "doc3.pdf"]:
    reader = PdfReader(pdf_file)
    for page in reader.pages:
        writer.add_page(page)

with open("merged.pdf", "wb") as output:
    writer.write(output)

Split PDF

reader = PdfReader("input.pdf")
for i, page in enumerate(reader.pages):
    writer = PdfWriter()
    writer.add_page(page)
    with open(f"page_{i+1}.pdf", "wb") as output:
        writer.write(output)

Extract Metadata

reader = PdfReader("document.pdf")
meta = reader.metadata
print(f"Title: {meta.title}")
print(f"Author: {meta.author}")
print(f"Subject: {meta.subject}")
print(f"Creator: {meta.creator}")

Rotate Pages

reader = PdfReader("input.pdf")
writer = PdfWriter()

page = reader.pages[0]
page.rotate(90)  # Rotate 90 degrees clockwise
writer.add_page(page)

with open("rotated.pdf", "wb") as output:
    writer.write(output)

pdfplumber - Text and Table Extraction

Extract Text with Layout

import pdfplumber

with pdfplumber.open("document.pdf") as pdf:
    for page in pdf.pages:
        text = page.extract_text()
        print(text)

Extract Tables

with pdfplumber.open("document.pdf") as pdf:
    for i, page in enumerate(pdf.pages):
        tables = page.extract_tables()
        for j, table in enumerate(tables):
            print(f"Table {j+1} on page {i+1}:")
            for row in table:
                print(row)

Advanced Table Extraction

import pandas as pd

with pdfplumber.open("document.pdf") as pdf:
    all_tables = []
    for page in pdf.pages:
        tables = page.extract_tables()
        for table in tables:
            if table:  # Check if table is not empty
                df = pd.DataFrame(table[1:], columns=table[0])
                all_tables.append(df)

# Combine all tables
if all_tables:
    combined_df = pd.concat(all_tables, ignore_index=True)
    combined_df.to_excel("extracted_tables.xlsx", index=False)

reportlab - Create PDFs

Basic PDF Creation

from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas

c = canvas.Canvas("hello.pdf", pagesize=letter)
width, height = letter

# Add text
c.drawString(100, height - 100, "Hello World!")
c.drawString(100, height - 120, "This is a PDF created with reportlab")

# Add a line
c.line(100, height - 140, 400, height - 140)

# Save
c.save()

Create PDF with Multiple Pages

from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak
from reportlab.lib.styles import getSampleStyleSheet

doc = SimpleDocTemplate("report.pdf", pagesize=letter)
styles = getSampleStyleSheet()
story = []

# Add content
title = Paragraph("Report Title", styles['Title'])
story.append(title)
story.append(Spacer(1, 12))

body = Paragraph("This is the body of the report. " * 20, styles['Normal'])
story.append(body)
story.append(PageBreak())

# Page 2
story.append(Paragraph("Page 2", styles['Heading1']))
story.append(Paragraph("Content for page 2", styles['Normal']))

# Build PDF
doc.build(story)

Subscripts and Superscripts

IMPORTANT: Never use Unicode subscript/superscript characters (₀₁₂₃₄₅₆₇₈₉, ⁰¹²³⁴⁵⁶⁷⁸⁹) in ReportLab PDFs. The built-in fonts do not include these glyphs, causing them to render as solid black boxes.

Instead, use ReportLab's XML markup tags in Paragraph objects:

from reportlab.platypus import Paragraph
from reportlab.lib.styles import getSampleStyleSheet

styles = getSampleStyleSheet()

# Subscripts: use <sub> tag
chemical = Paragraph("H<sub>2</sub>O", styles['Normal'])

# Superscripts: use <super> tag
squared = Paragraph("x<super>2</super> + y<super>2</super>", styles['Normal'])

For canvas-drawn text (not Paragraph objects), manually adjust font the size and position rather than using Unicode subscripts/superscripts.

Command-Line Tools

pdftotext (poppler-utils)

# Extract text
pdftotext input.pdf output.txt

# Extract text preserving layout
pdftotext -layout input.pdf output.txt

# Extract specific pages
pdftotext -f 1 -l 5 input.pdf output.txt  # Pages 1-5

qpdf

# Merge PDFs
qpdf --empty --pages file1.pdf file2.pdf -- merged.pdf

# Split pages
qpdf input.pdf --pages . 1-5 -- pages1-5.pdf
qpdf input.pdf --pages . 6-10 -- pages6-10.pdf

# Rotate pages
qpdf input.pdf output.pdf --rotate=+90:1  # Rotate page 1 by 90 degrees

# Remove password
qpdf --password=mypassword --decrypt encrypted.pdf decrypted.pdf

pdftk (if available)

# Merge
pdftk file1.pdf file2.pdf cat output merged.pdf

# Split
pdftk input.pdf burst

# Rotate
pdftk input.pdf rotate 1east output rotated.pdf

Common Tasks

Extract Text from Scanned PDFs

# Requires: pip install pytesseract pdf2image
import pytesseract
from pdf2image import convert_from_path

# Convert PDF to images
images = convert_from_path('scanned.pdf')

# OCR each page
text = ""
for i, image in enumerate(images):
    text += f"Page {i+1}:\n"
    text += pytesseract.image_to_string(image)
    text += "\n\n"

print(text)

Add Watermark

from pypdf import PdfReader, PdfWriter

# Create watermark (or load existing)
watermark = PdfReader("watermark.pdf").pages[0]

# Apply to all pages
reader = PdfReader("document.pdf")
writer = PdfWriter()

for page in reader.pages:
    page.merge_page(watermark)
    writer.add_page(page)

with open("watermarked.pdf", "wb") as output:
    writer.write(output)

Extract Images

# Using pdfimages (poppler-utils)
pdfimages -j input.pdf output_prefix

# This extracts all images as output_prefix-000.jpg, output_prefix-001.jpg, etc.

Password Protection

from pypdf import PdfReader, PdfWriter

reader = PdfReader("input.pdf")
writer = PdfWriter()

for page in reader.pages:
    writer.add_page(page)

# Add password
writer.encrypt("userpassword", "ownerpassword")

with open("encrypted.pdf", "wb") as output:
    writer.write(output)

Quick Reference

TaskBest ToolCommand/Code
Merge PDFspypdfwriter.add_page(page)
Split PDFspypdfOne page per file
Extract textpdfplumberpage.extract_text()
Extract tablespdfplumberpage.extract_tables()
Create PDFsreportlabCanvas or Platypus
Command line mergeqpdfqpdf --empty --pages ...
OCR scanned PDFspytesseractConvert to image first
Fill PDF formspdf-lib or pypdf (see FORMS.md)See FORMS.md

Next Steps

  • For advanced pypdfium2 usage, see REFERENCE.md
  • For JavaScript libraries (pdf-lib), see REFERENCE.md
  • If you need to fill out a PDF form, follow the instructions in FORMS.md
  • For troubleshooting guides, see REFERENCE.md
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
legal-design-assessmentAudits a legal document against legal design principles. Scores the document on six pillars: language patterns (bureaucratese, archaisms, passive voice, nominalization), readability (Flesch Reading Ease and language-specific equivalents), structure and navigation, hidden conditions (material obligations buried away from their headings), statutory duplication (restating the law instead of citing it), and visual hierarchy where layout is available. Assessment-only; does not rewrite the document. Works on English, French, and German documents, inferring the applicable jurisdiction from the document's language and textual signals: governing-law clause, statute citations, party addresses. Use when a user shares a legal document (contract, NDA, T&C, privacy policy, internal policy) asking how good the drafting is from a legal design perspective, whether it is readable, whether it contains buried clauses or restates the law, or how it scores on Flesch / LIX / Amstad / Kandel-Moles readability2 installseu-ai-act-classificationClassify AI systems under the EU AI Act (Regulation (EU) 2024/1689) and determine compliance obligations. Use when asked to assess AI risk level, check if an AI system is prohibited, determine high-risk status, identify GPAI model obligations, map provider/deployer responsibilities, or build an AI Act compliance roadmap. Covers the full classification decision tree (Prohibited → High-Risk → Limited → Minimal → GPAI), obligations by role (provider, deployer, importer, distributor), compliance timelines, and DACH-specific considerations (German works council, BaFin, BSI, BNetzA). Triggers on phrases like "classify this AI system", "is this high-risk under the AI Act", "AI Act risk assessment", "EU AI Act compliance", "prohibited AI practice", "GPAI obligations", "AI Act timeline".2 installslegal-translationTranslate legal documents from any language into English while preserving .docx formatting and translating track changes and headers/footers. Use this skill whenever the user asks to translate a legal document, contract, deed, agreement, or any formal legal text into English. Also trigger when the user mentions translating .docx files that contain legal content, or asks for a "format-preserving translation" of a legal document. This skill covers all legal domains: finance, M&A, corporate, IP, real estate, regulatory, consumer, taxes, litigation, SaaS and more. Even if the user just says "translate this contract" or "translate this into English", use this skill if the document is legal in nature.2 installseardraftTransforms reading-oriented prose into listening-optimized text for flat, neutral vocal delivery — TTS, podcasts, audiobooks, CLE audio. Carries a legal layer: case citations, section symbols, subsection lettering, Latin terms and footnotes are unspeakable as written, so a brief, opinion, statute, contract or memo needs them expanded, restructured or stripped before it can be listened to — and quoted authority is never rewritten. Use when converting written content for audio, preparing oral argument by ear, producing CLE or client-facing audio, or making a document listenable on a commute. Triggers on "make this listenable," "convert for audio," "optimize for reading aloud," "prepare for TTS," "make an audio version," "podcast script," "read this aloud." Supports English, French, Spanish, Italian, German and Portuguese; outputs plain text, ElevenLabs audio tags, or SSML for Amazon Polly, Google or Azure.2 installslegal-translation-USTranslate legal documents from any language into English while preserving .docx formatting and translating track changes and headers/footers. Use this skill whenever the user asks to translate a legal document, contract, deed, agreement, or any formal legal text into English. Also trigger when the user mentions translating .docx files that contain legal content, or asks for a "format-preserving translation" of a legal document. This skill covers all legal domains: finance, M&A, corporate, IP, real estate, regulatory, consumer, taxes, litigation, SaaS and more. Even if the user just says "translate this contract" or "translate this into English", use this skill if the document is legal in nature.2 installsWord EditorEdit, query, and transform Word documents (.docx) with the SuperDoc CLI. Use when the user asks to read, search, modify, format, comment, track changes, or review changes in .docx files. Triggers on any task involving Word documents — text replacement, redlining, contract markup, template filling, bulk edits, content extraction, or document review.2 installs
View source →
persuasive-legal-writingApply elite legal writing techniques drawn from Justice Kagan, Boies & Olson, and other top advocates to any legal document — briefs, submissions, letters, opinions, memos, or persuasive correspondence. This skill covers both prose craft (clarity, examples, parallel construction, voice, quoting) and architectural strategy (argument sequencing, framing, openings, endings). Use this skill whenever the user asks you to draft, edit, or improve legal writing and wants it to be genuinely persuasive — not just correct. Also trigger when the user mentions 'make it more persuasive', 'sharpen this', 'strengthen the argument', 'rewrite this section', 'punch it up', 'legal writing', 'draft a brief', 'draft a submission', 'write like a top advocate', or asks you to improve the rhetoric, flow, or force of any legal document. This skill complements the larissa-legal-voice skill (which handles tone and personal voice) by adding the persuasive technique layer on top.7 installsdpdpaExpert India Digital Personal Data Protection Act, 2023 (DPDPA) compliance advisor. Use this skill whenever a user asks about the DPDPA, DPDP Act, DPDP Rules 2025, India data privacy law, Data Fiduciary obligations, Data Principal rights, Significant Data Fiduciary, Data Protection Board of India, consent under DPDPA, notice requirements, breach notification India, children's data India, cross-border data transfer India, India privacy compliance, DPDPA gap analysis, DPDPA vs GDPR, or any obligation under India's personal data protection framework. Also trigger for: "Section 6 consent", "Section 7 legitimate uses", "Section 9 children's data", "Section 10 SDF", "Section 16 cross-border", "Rule 6 breach notification", "Rule 13 SDF obligations", "Data Protection Board complaint", "verifiable parental consent India", "DPDPA compliance roadmap", or "India privacy law global company".4 installsroute-legal-translationPick the right LLM for LEGAL TRANSLATION — translating contracts, statutes, case law, and legal correspondence across languages, including Arabic/MENA. Vendor-neutral routing triangulated from mid-2026 evidence (WMT25 human eval, SwiLTra-Bench legal-MT, multilingual-reasoning proxies, ArabLegalEval). There is NO clean legal-translation leaderboard, so this vertical is directional and treats human legal-linguist review as mandatory. Asks up to 4 quick questions (language pair, cost, speed, privacy/certification), then recommends a primary model + fallback + what to avoid + what a human must verify. Use when someone asks "which model to translate this contract/statute", "best AI for legal translation", "translate this legal doc to/from Arabic", or is about to machine-translate legal text without a fixed model.3 installsassistant-juridique-frAssistant juridique expert en droit français, pour les praticiens : recherches, consultations et cas pratiques, rédaction d'actes, analyse de pièces, contre-argumentaires, analyse de contrats, veille, analyse d'articles, vérification et harmonisation de références. Recherche outillée (LibreJustice, OpenLegi, Themia, LegalDataHunter, doctrine HAL/OpenAlex), noyau anti-hallucination avec tableau de vérification remis en document séparé, livrables Word par défaut (Docs sur demande). À utiliser pour toute question juridique ou tout concept de droit français (contrat, responsabilité, jurisprudence, code civil, procédure, indemnisation), toute question de droit de l'UE, de CJUE ou de CEDH, et toute demande de vérification ou d'harmonisation de références juridiques, même si l'utilisateur ne nomme pas la skill.3 installsskill-optimizer-lawvableGuide to analyze a current work session and propose improvements to skills. Use (1) automatically after working with a skill to capture learnings, (2) when the user suggests improvements, corrections, or additions during a skill-related session, or (3) when the user manually invokes `self-improve`.3 installslegal-risk-assessmentAssess and classify legal risks using a severity-by-likelihood framework with escalation criteria. Use when evaluating contract risk, assessing deal exposure, classifying issues by severity, or determining whether a matter needs senior counsel or outside legal review.2 installs
Browse category →
financial-analystAnalyze financial statements, value a company with a DCF, explain budget variance, build rolling forecasts. Use whenever the user asks what a business is worth or why spend missed budget.12 installsresume-interview-generator基于候选人简历自动生成面试题、笔试题、追问路径和评分标准的 AI Skill。当用户需要准备技术面试、生成笔试题目、评估候选人简历、或设计面试评估方案时使用。输入简历内容和岗位信息后,自动输出结构化的题目与评估内容,支持面试题模式、笔试题模式、综合评估模式等多种输出形式。5 installsresume-interview-generator基于候选人简历自动生成面试题、笔试题、追问路径和评分标准的 AI Skill。当用户需要准备技术面试、生成笔试题目、评估候选人简历、或设计面试评估方案时使用。输入简历内容和岗位信息后,自动输出结构化的题目与评估内容,支持面试题模式、笔试题模式、综合评估模式等多种输出形式。4 installshr-recruitingHelp HR managers with end-to-end recruiting and talent acquisition. Use when asked to write or improve a job description for a role, create interview questions, screen resumes, develop employer branding, send offer letters, conduct reference checks, or any other recruiting and hiring task, or handle day-to-day recruiting tasks for a role.4 installsregulatory-affairs-headUse for medical device market access strategy: FDA 510(k), De Novo or PMA packages, CE marking under MDR, pre-sub meetings, agency deficiency responses or multi-market plans. Analyzes pathways with regulatory_pathway_analyzer.py and tracks submissions with regulatory_tracker.py.3 installssaas-metrics-coachUse when someone shares SaaS revenue or customer numbers, or asks about ARR, MRR, churn, LTV, CAC, NRR or how their SaaS is doing. Computes metrics with metrics_calculator.py, quick ratio and unit economics.2 installs
What does the pdf-processing-anthropic skill do?

Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the pdf-processing-anthropic skill?

Run `npx @skills-hub-ai/cli install legal-skills-pdf-processing-anthropic` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/legal-skills-pdf-processing-anthropic/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does pdf-processing-anthropic work with?

pdf-processing-anthropic runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the pdf-processing-anthropic skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use pdf-processing-anthropic after installing it?

In Claude Code, type `/legal-skills-pdf-processing-anthropic` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the pdf-processing-anthropic skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.