pdf

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

Updated Sep 11, 2026
One-click install
npx skills add https://github.com/CYRUS-pinto/pi-bot --skill pdf-cyrus-pinto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/CYRUS-pinto/pi-bot/tree/main/.agents/skills/pdf
Command: npx skills add https://github.com/CYRUS-pinto/pi-bot --skill pdf-cyrus-pinto

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, and tasks like filling forms, extracting tables, or handling scanned documents each require different approaches. This Skill consolidates PDF processing operations into one guide with ready-to-use code and scripts. ## 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, metadata, and embedded images with pdfplumber, pypdf, and poppler-utils, including OCR for scanned documents via pytesseract. - PDF Creation: Generate new PDFs with reportlab or JavaScript libraries like pdf-lib, including styled reports with tables. - Form Filling: Fill both fillable AcroForm fields and non-fillable forms using annotation-based workflows with coordinate validation scripts. - Use Case: You receive a stack of scanned contract PDFs. Use this Skill to convert pages to images, run OCR to extract text, then fill a summary form PDF programmatically. ## Quick Start Use the pdf skill to merge the three attached PDF reports into a single document and extract the table from page two.

Frequently Asked Questions about pdf

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

FAQPage Schema
How do I merge multiple PDF files in Python?

Use pypdf's PdfWriter to merge PDFs by adding pages from each source file with writer.add_page, then write the output. Alternatively, run qpdf --empty --pages file1.pdf file2.pdf -- merged.pdf from the command line.

How do I extract tables from a PDF document?

Use pdfplumber's page.extract_tables() method, which detects table structures and returns rows as lists. You can convert results to pandas DataFrames and export them to Excel for further analysis.

How do I fill a PDF form programmatically?

First run check_fillable_fields.py to detect form fields. Fillable PDFs are filled with fill_fillable_fields.py using a JSON of field values; non-fillable PDFs use fill_pdf_form_with_annotations.py with bounding box coordinates.

Can I extract text from a scanned PDF?

Scanned PDFs contain images, not text layers, so standard extraction fails. Convert pages to images with pdf2image, then run pytesseract OCR on each image to produce searchable text.

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.