pdf

Extract text, tables, metadata, and form data from PDF documents.

23|9|Updated May 24, 2025
One-click install
npx skills add https://github.com/xiehust/strands_demos --skill pdf-xiehust
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/xiehust/strands_demos/tree/main/strands_skills_demo/skills/pdf
Command: npx skills add https://github.com/xiehust/strands_demos --skill pdf-xiehust

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypdf, pdfplumber, reportlab, pytesseract, pdf2image, pypdfium2, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Eliminates the tedious manual work of filling out PDF forms and extracting data from documents, saving you hours of repetitive effort. It enables programmatic processing, generation, and analysis of PDFs at scale, reducing complexity and human error.

Core Features & Use Cases

  • Automated Form Filling: Programmatically fill both fillable and non-fillable PDF forms with precision.
  • Data Extraction: Pull text and structured table data from any PDF into usable formats like CSV or Excel.
  • Document Manipulation: Merge, split, rotate, and password-protect PDF documents for efficient management.
  • Use Case: Automatically extract invoice details from hundreds of PDF invoices into a spreadsheet, or pre-fill complex application forms for multiple users, ensuring accuracy and saving countless hours.

Quick Start

Example: Read a PDF and extract text

from pypdf import PdfReader import pdfplumber

Read a PDF

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

Extract text with layout

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

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 PDF documents programmatically?

Extract text and tables from PDFs using pypdf and pdfplumber libraries, which parse document content and return structured data. Both handle standard and complex layouts, outputting text strings and table arrays you can process into CSV, Excel, or JSON formats for further analysis.

Can I automatically fill out PDF forms with data?

Yes, pypdf and reportlab enable programmatic form filling by writing field values directly into fillable and non-fillable PDF forms. You can batch-process multiple forms with data from spreadsheets or databases, automating what would otherwise require manual entry.

What's the best way to process scanned PDF documents with OCR?

Use pytesseract with pdf2image to convert scanned pages to images, then apply OCR to extract text from image-based content. This workflow handles PDFs containing photos or handwritten material that standard text extraction cannot read.

How do I merge, split, and rotate multiple PDF files?

Merge, split, and rotate PDFs using pypdf for document manipulation tasks. Combine multiple files into one, extract specific page ranges, or adjust page orientation—all operations return modified PDF objects ready to save or process further.

Can I extract metadata and apply passwords to PDFs?

Extract document metadata like creation date and author using pypdf and pdfplumber, and add password protection with pypdf. Both operations support batch workflows, letting you audit document properties and secure files at scale.

Does PDF automation work for large-scale document processing?

PDF automation scales to hundreds or thousands of documents through batch processing with pypdf, pdfplumber, and CLI tools like pdftotext and qpdf. Process documents in parallel loops, extract data in bulk, and export results as structured datasets without manual intervention.