Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
davila7 avatar

Pdf Processing

  • 246 installs
  • 30.1k repo stars
  • Updated August 4, 2026
  • davila7/claude-code-templates

pdf-processing is a Claude Code skill that teaches pypdf, pdfplumber, reportlab, and CLI tools to extract, merge, split, OCR, and transform PDFs for developers who ingest documents in backends or automation jobs.

About

pdf-processing is a document-handling skill from davila7/claude-code-templates that guides Python and command-line workflows for reading, creating, merging, splitting, rotating, watermarking, encrypting, and OCR-processing PDF files. It covers pypdf for basic operations, pdfplumber for text and table extraction to Excel, reportlab for PDF generation, plus qpdf, pdftotext, and pytesseract for CLI and scanned-document tasks. Developers reach for pdf-processing when a feature touches .pdf uploads, invoice parsing, form filling, or compliance document pipelines. Companion references FORMS.md and REFERENCE.md cover advanced form fill and JavaScript pdf-lib patterns. The quick-reference table maps eight common tasks to the best library or command.

  • Text and table extraction patterns
  • Merge, split, and rotate operations
  • OCR and scanned-document handling
  • Metadata and page-level processing
  • Backend ingestion pipeline templates

Pdf Processing by the numbers

  • 246 all-time installs (skills.sh)
  • Ranked #212 of 688 Office & Documents skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/davila7/claude-code-templates --skill pdf-processing

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs246
repo stars30.1k
Last updatedAugust 4, 2026
Repositorydavila7/claude-code-templates

How do you extract tables from PDFs in Python?

Extract, merge, split, OCR, and transform PDFs in app backends or automation jobs when documents are ingestion sources for search, billing, or compliance flows.

Who is it for?

Python developers building document ingestion, billing parsers, or compliance workflows that must read, transform, or generate PDF files programmatically.

Skip if: Teams needing only quick PDF viewing in a browser or production batch pipelines that require the separate pdf-processing-pro scripted toolkit.

When should I use this skill?

User mentions .pdf files, asks to extract text or tables, merge documents, fill PDF forms, or add OCR to scanned uploads.

What you get

Extracted text files, CSV or Excel tables, merged or split PDFs, filled forms, OCR text from scanned documents

  • extracted text
  • CSV or Excel tables
  • transformed PDF files

By the numbers

  • Quick-reference table covers 8 common PDF tasks across libraries and CLI tools
  • Documents pypdf, pdfplumber, reportlab, qpdf, pdftotext, and pytesseract workflows

Files

SKILL.mdMarkdownGitHub ↗

PDF Processing

Quick start

Use pdfplumber to extract text from PDFs:

import pdfplumber

with pdfplumber.open("document.pdf") as pdf:
    text = pdf.pages[0].extract_text()
    print(text)

Extracting tables

Extract tables from PDFs with automatic detection:

import pdfplumber

with pdfplumber.open("report.pdf") as pdf:
    page = pdf.pages[0]
    tables = page.extract_tables()

    for table in tables:
        for row in table:
            print(row)

Extracting all pages

Process multi-page documents efficiently:

import pdfplumber

with pdfplumber.open("document.pdf") as pdf:
    full_text = ""
    for page in pdf.pages:
        full_text += page.extract_text() + "\n\n"

    print(full_text)

Form filling

For PDF form filling, see FORMS.md for the complete guide including field analysis and validation.

Merging PDFs

Combine multiple PDF files:

from pypdf import PdfMerger

merger = PdfMerger()

for pdf in ["file1.pdf", "file2.pdf", "file3.pdf"]:
    merger.append(pdf)

merger.write("merged.pdf")
merger.close()

Splitting PDFs

Extract specific pages or ranges:

from pypdf import PdfReader, PdfWriter

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

# Extract pages 2-5
for page_num in range(1, 5):
    writer.add_page(reader.pages[page_num])

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

Available packages

  • pdfplumber - Text and table extraction (recommended)
  • pypdf - PDF manipulation, merging, splitting
  • pdf2image - Convert PDFs to images (requires poppler)
  • pytesseract - OCR for scanned PDFs (requires tesseract)

Common patterns

Extract and save text:

import pdfplumber

with pdfplumber.open("input.pdf") as pdf:
    text = "\n\n".join(page.extract_text() for page in pdf.pages)

with open("output.txt", "w") as f:
    f.write(text)

Extract tables to CSV:

import pdfplumber
import csv

with pdfplumber.open("tables.pdf") as pdf:
    tables = pdf.pages[0].extract_tables()

    with open("output.csv", "w", newline="") as f:
        writer = csv.writer(f)
        for table in tables:
            writer.writerows(table)

Error handling

Handle common PDF issues:

import pdfplumber

try:
    with pdfplumber.open("document.pdf") as pdf:
        if len(pdf.pages) == 0:
            print("PDF has no pages")
        else:
            text = pdf.pages[0].extract_text()
            if text is None or text.strip() == "":
                print("Page contains no extractable text (might be scanned)")
            else:
                print(text)
except Exception as e:
    print(f"Error processing PDF: {e}")

Performance tips

  • Process pages in batches for large PDFs
  • Use multiprocessing for multiple files
  • Extract only needed pages rather than entire document
  • Close PDF objects after use

Related skills

How it compares

Pick pdf-processing for library snippets and common Python PDF tasks; choose pdf-processing-pro in the same repo when you need pre-built CLI scripts with validation for production batch jobs.

FAQ

Which Python library extracts PDF tables?

pdf-processing recommends pdfplumber with page.extract_tables(), optionally exporting combined results to Excel via pandas, while pypdf handles merge, split, rotate, and encryption tasks.

How does pdf-processing handle scanned PDFs?

pdf-processing converts scanned pages to images with pdf2image, then runs pytesseract OCR per page to produce searchable text output from otherwise image-only documents.

What CLI tools does pdf-processing document?

pdf-processing documents qpdf for merge and split, pdftotext from poppler-utils for layout-preserving extraction, and pdftk when available for burst and rotate operations.

Office & Documentsworkflownotes

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.