pdf

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

57.2k|7.0k|Updated Dec 28, 2025
Ready to run
npx skills add https://github.com/HKUDS/DeepTutor --skill pdf-hkuds
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/HKUDS/DeepTutor/tree/main/deeptutor/skills/builtin/pdf
Command: npx skills add https://github.com/HKUDS/DeepTutor --skill pdf-hkuds

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pdfplumber, pypdf, reportlab, openpyxl, PyMuPDF, and includes scripts (resource) and references (resource) components.

What problem does it solve? Manually copying data from PDFs—whether invoices, forms, or reports—is time-consuming and error-prone. This Skill automates text extraction, table parsing, form filling, document merging, and PDF creation so you can programmatically work with PDF content at scale. ## Core Features & Use Cases - Text & Table Extraction: Pull layout-aware text and structured table data using pdfplumber; fast raw text with pypdf. - Document Operations: Merge, split, rotate, crop, watermark, encrypt, and decrypt PDFs. - Form Handling: Fill fillable AcroForm fields or overlay text on flat forms; detect and populate checkboxes and radio buttons. - PDF Creation: Build reports from scratch with reportlab, including support for non-Latin text (Chinese, Japanese, Korean, Cyrillic). - Page Rendering: Convert PDF pages to PNG images for visual inspection or downstream image processing. - Use Case: Extract vendor name, invoice number, and total from 200 PDF invoices, compile into Excel, then merge all invoices into a single archival PDF with a watermark. ## Quick Start Upload a PDF file and ask me to extract all text, pull table data into a spreadsheet, fill form fields with specific values, or convert pages to images.

Frequently Asked Questions about pdf

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

FAQPage Schema
How do I extract tables from a PDF into Excel?▼

Use pdfplumber to detect and extract tables from each page, then write them to openpyxl worksheets. The Skill provides a complete example that creates one Excel sheet per detected table with automatic row/cell population.

What's the difference between pdfplumber and pypdf for text extraction?▼

pdfplumber preserves layout-aware text structure (paragraphs, columns, spacing) and excels at table detection; pypdf extracts raw text faster but loses spatial context. Choose pdfplumber for precise data, pypdf for volume.

Can I fill PDF forms programmatically?▼

Yes. First check if the PDF has fillable AcroForm fields using `get_fields()`. If it does, populate them with pypdf and set the NeedAppearances flag. For flat forms without fields, overlay FreeText annotations at specific coordinates.

Why does text extraction return empty or garbled output?▼

The PDF is likely scanned (image-only with no text layer). No OCR engine is available in the sandbox, so you cannot recover that text. Scanned PDFs require external OCR tools unavailable in this environment.

Does the Skill support non-Latin languages in PDF creation?▼

Yes, but only with registered CJK-capable TrueType fonts. Built-in reportlab fonts carry zero glyphs for Chinese, Japanese, Korean, or Cyrillic—the Skill automatically registers system fonts like wqy-zenhei or raises an error if none exist.

How do I convert PDF pages to images?▼

Use PyMuPDF (imported as `fitz`). Call `page.get_pixmap(dpi=150)` on each page and save as PNG. Higher DPI produces sharper, larger images. Note: rendered scanned pages are still pixels and cannot be OCR'd in the sandbox.