pdf

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

Updated Feb 20, 2026
One-click install
npx skills add https://github.com/gtbauke/bj-utils --skill pdf-gtbauke
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/gtbauke/bj-utils/tree/main/.agent/skills/pdf
Command: npx skills add https://github.com/gtbauke/bj-utils --skill pdf-gtbauke

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypdf, pdfplumber, pdf2image, Pillow, pytesseract, reportlab, pypdfium2, 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 operations into one guide with ready-to-use code and scripts. ## Core Features & Use Cases - PDF Manipulation: Merge, split, rotate, encrypt, decrypt, watermark, and extract text, tables, images, and metadata using pypdf, pdfplumber, reportlab, qpdf, and poppler-utils. - PDF Form Filling: Fill both fillable and non-fillable PDF forms using dedicated scripts that extract field info, validate bounding boxes, and write values or text annotations. - OCR & Creation: Run OCR on scanned PDFs with pytesseract and generate new PDFs with reportlab or JavaScript libraries like pdf-lib. - Use Case: You receive a non-fillable government form as a PDF. The Skill extracts the form structure, lets you define field coordinates, validates them, and produces a completed PDF with text placed precisely. ## Quick Start Use the pdf skill to merge these three PDF files into a single document and extract the text from the first page.

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 preserved and tables via page.extract_tables(), which returns rows you can load into pandas DataFrames. For simple text extraction, pypdf's page.extract_text() or the pdftotext command-line tool also work.

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

Extract the form structure with pdfplumber to get label and checkbox coordinates, define entry bounding boxes in a fields.json file, validate them with the check_bounding_boxes script, then add text annotations using pypdf's FreeText annotations.

What is the difference between pypdf and pdfplumber?▼

pypdf handles structural operations like merging, splitting, rotating, encrypting, and form field updates. pdfplumber focuses on content extraction, providing precise character coordinates and table detection for data extraction tasks.

Can I extract text from a scanned PDF?▼

Scanned PDFs contain images without a text layer, so standard parsers return nothing. 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 of Unicode characters.

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 -- output.pdf'. The pdftk tool offers equivalent cat and burst operations.