pdf-extraction

Extract text, tables, and metadata from PDF documents using pdfplumber.

Updated May 23, 2026
One-click install
npx skills add https://github.com/Oatse/CWE-Automation --skill pdf-extraction-oatse
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf-extraction
Source: https://github.com/Oatse/CWE-Automation/tree/main/.agents/skills/pdf-extraction
Command: npx skills add https://github.com/Oatse/CWE-Automation --skill pdf-extraction-oatse

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pdfplumber, pandas, Pillow.

What problem does it solve? Manually copying text and tables out of PDF files is slow and error-prone, especially for financial reports, invoices, and multi-page documents. This Skill generates and runs pdfplumber code to pull structured data directly from PDFs. ## Core Features & Use Cases - Text Extraction: Extract text from single pages, page ranges, or entire documents with layout preservation and character-level positioning. - Table Extraction: Detect and extract tables with tunable settings, then convert them to pandas DataFrames, CSV, or Excel files. - Metadata & Region Cropping: Read document metadata, crop to bounding boxes, and filter content by font or position. - Use Case: Extract every table from a 50-page annual financial report and save each one as a separate sheet in an Excel workbook. ## Quick Start Extract all tables from the attached PDF report and save them to an Excel file.

Frequently Asked Questions about pdf-extraction

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

FAQPage Schema
How do I extract tables from a PDF in Python?

Use pdfplumber's extract_tables() method on each page to detect and extract tables based on line or text strategies. The result is a list of rows that can be loaded into a pandas DataFrame and exported to CSV or Excel.

How to extract text from specific pages of a PDF?

Open the file with pdfplumber and call extract_text() on the desired page objects, such as pdf.pages[4:10] for pages 5-10. You can adjust x_tolerance, y_tolerance, and layout options to control grouping and formatting.

Can pdfplumber extract text from scanned PDFs?

No, pdfplumber only works with PDFs containing a native text layer. Scanned or image-based PDFs require OCR processing first, since there are no extractable characters for the library to read.

Why does PDF table extraction return wrong or empty results?

Table detection depends on the chosen vertical and horizontal strategies and tolerance settings. Tables without visible ruling lines often need the text strategy, and adjusting snap_tolerance and join_tolerance improves detection accuracy.

How do I debug table detection in pdfplumber?

Use page.to_image() to render the page, then call debug_tablefinder() and save the image to see detected cells and edges. You can also draw character, word, and line bounding boxes to inspect the page structure visually.