pdf

Extract text, merge, split, rotate, and watermark PDFs using Python libraries.

16|1|Updated Jan 2, 2026
One-click install
npx skills add https://github.com/bahayonghang/my-claude-code-settings --skill pdf-bahayonghang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/bahayonghang/my-claude-code-settings/tree/main/skills/pdf
Command: npx skills add https://github.com/bahayonghang/my-claude-code-settings --skill pdf-bahayonghang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypdf, pdfplumber, pdf2image, Pillow, and includes scripts (resource) components.

What problem does it solve?

This Skill automates a wide range of PDF tasks (text extraction, page manipulation, form handling, and document creation), reducing manual effort and enabling batch processing.

Core Features & Use Cases

  • Extract text and tables from PDFs using pypdf, pdfplumber, and OCR when needed.
  • Merge, split, rotate, and watermark PDFs; create new PDFs; fill fillable and non-fillable forms.
  • Use cases: archiving, invoice processing, report generation, and mass document preprocessing.

Quick Start

Use Python to merge PDFs, extract text, and apply basic edits. For example:

  • Merge PDFs: from pypdf import PdfReader, PdfWriter writer = PdfWriter() for pdf in ['doc1.pdf','doc2.pdf']: reader = PdfReader(pdf) for page in reader.pages: writer.add_page(page) with open('merged.pdf', 'wb') as f: writer.write(f)
  • Extract text: from pypdf import PdfReader reader = PdfReader("document.pdf") text = "" for page in reader.pages: text += page.extract_text() or ""
  • Rotate first page: reader = PdfReader("document.pdf") writer = PdfWriter() page = reader.pages[0] page.rotate(90) writer.add_page(page) with open("rotated.pdf","wb") as f: writer.write(f)

Frequently Asked Questions about pdf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract text and tables from a PDF using Python?

To extract text and tables from a PDF, you can use Python libraries like pdfplumber and pypdf. For scanned PDFs requiring OCR, optional OCR tooling processes the document images to retrieve text data from visual layouts.

What is the best way to merge, split, and rotate PDF pages in Python?

The best way to merge, split, and rotate PDFs is using the pypdf library in Python. You can read multiple documents, iterate through pages, apply rotations like 90 degrees, and write the combined or modified pages into a new output file.

Can I use Python to fill fillable and non-fillable PDF forms automatically?

Yes, you can fill both fillable and non-fillable PDF forms automatically using Python. This Skill handles form automation by leveraging pypdf and pdfplumber to populate document fields across large administrative datasets.

Does this PDF processing approach support adding watermarks and creating new documents?

Yes, this PDF processing approach supports adding watermarks and creating new documents. You can manipulate existing pages or generate new PDFs entirely, enabling automated document preparation, archiving, and report generation workflows.

Do I need OCR tooling to extract text from scanned PDF documents?

You need OCR tooling to extract text from scanned PDF documents when standard text extraction fails. While pypdf and pdfplumber handle digital text, OCR processes image-based scanned pages using dependencies like pdf2image and Pillow.

Why use pdfplumber alongside pypdf for PDF data extraction?

You use pdfplumber alongside pypdf for PDF data extraction because pdfplumber specializes in parsing complex table structures and layouts, whereas pypdf efficiently handles basic text extraction and page manipulation like merging and rotation.