pdf

Extract, merge, split, create, and fill PDF documents using Python libraries and command-line tools.

Updated May 5, 2026
One-click install
npx skills add https://github.com/UlaYuga/promo-preflight --skill pdf-ulayuga
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/UlaYuga/promo-preflight/tree/main/.agents/skills/pdf
Command: npx skills add https://github.com/UlaYuga/promo-preflight --skill pdf-ulayuga

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Working with PDF files programmatically is fragmented across many libraries and tools, making tasks like text extraction, form filling, merging, and OCR error-prone without clear guidance on which tool fits each job. ## Core Features & Use Cases - PDF Manipulation: Merge, split, rotate, encrypt, decrypt, watermark, and crop PDFs using pypdf, qpdf, and pdftk. - Content Extraction: Extract text, tables, images, and metadata with pdfplumber, pdftotext, and pdfimages, including OCR for scanned documents via pytesseract. - PDF Creation: Generate new PDFs with reportlab or pdf-lib, including styled tables and multi-page reports. - Form Filling: Fill both fillable AcroForm fields and non-fillable forms via coordinate-based text annotations, with validation scripts for bounding boxes. - Use Case: Given a scanned non-fillable application form, convert pages to images, estimate field coordinates with zoom refinement, validate bounding boxes, and produce a filled PDF with placed text annotations. ## Quick Start Use the pdf skill to extract all text and tables from the attached report.pdf and save the tables to a spreadsheet.

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 in Python?▼

Use pdfplumber to extract text with layout and tables via page.extract_text() and page.extract_tables(). For plain text only, pdftotext from poppler-utils is faster, and pypdf handles basic text and metadata extraction.

How do I fill a PDF form that has no fillable fields?▼

Extract the form structure with pdfplumber to get label and line coordinates, or convert pages to images and visually estimate field positions. Then add text annotations at those coordinates using pypdf FreeText annotations via the fill_pdf_form_with_annotations.py script.

What is the difference between pypdf, pdfplumber, and reportlab?▼

pypdf handles merging, splitting, rotating, encryption, and form field updates. pdfplumber specializes in text and table extraction with precise coordinates. reportlab creates new PDFs from scratch with styled paragraphs and tables.

Can I extract text from a scanned PDF?▼

Scanned PDFs have no text layer, so standard parsers return nothing. Convert pages to images with pdf2image, then run OCR with pytesseract to recognize the text on each page.

Why do subscript characters render as black boxes in reportlab PDFs?▼

ReportLab's built-in fonts lack Unicode subscript and superscript glyphs, so those characters render as solid boxes. Use the <sub> and <super> XML markup tags inside Paragraph objects instead.

How do I merge or split PDFs from the command line?▼

Use qpdf: merge with 'qpdf --empty --pages file1.pdf file2.pdf -- merged.pdf' and split page ranges with 'qpdf input.pdf --pages . 1-5 -- out.pdf'. pdftk offers similar cat and burst operations if installed.