pdf

Read, merge, split, fill, and generate PDF documents using Python libraries and command-line tools.

52|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/Immortalqx/my_codex_skills --skill pdf-immortalqx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/Immortalqx/my_codex_skills/tree/main/pdf
Command: npx skills add https://github.com/Immortalqx/my_codex_skills --skill pdf-immortalqx

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 non-fillable forms, extracting tables, or handling scanned documents require knowing which tool fits each situation. This Skill provides a complete operational guide with ready-to-use code and scripts for the full range of PDF operations. ## 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 Generation: Create new PDFs with reportlab or JavaScript's pdf-lib, including styled tables and correct subscript/superscript rendering. - Form Filling: A guided workflow with bundled scripts handles both fillable AcroForm fields and non-fillable forms via structure extraction, coordinate validation, and annotation-based filling. - Use Case: Given a scanned government form with no fillable fields, the Skill converts pages to images, refines field coordinates through zoomed crops, validates bounding boxes, and produces a filled PDF with verified text placement. ## Quick Start Use the pdf skill to merge these three PDF files into one document and extract the text from the result.

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 each page from the source files 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 fill a PDF form that has no fillable fields?

Extract the form structure with the extract_form_structure.py script to get label and checkbox coordinates, build a fields.json with entry bounding boxes, validate it with check_bounding_boxes.py, then fill it using fill_pdf_form_with_annotations.py.

What Python library should I use to extract tables from PDFs?

Use pdfplumber for table extraction; its page.extract_tables() method detects cell boundaries and returns rows as lists you can load into pandas DataFrames. For complex layouts, adjust table settings like snap_tolerance and intersection_tolerance.

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 and run OCR with pytesseract to recover the text content.

Why do subscripts render as black boxes in reportlab PDFs?

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

How do I remove a password from an encrypted PDF?

Run qpdf --password=yourpassword --decrypt encrypted.pdf decrypted.pdf to produce an unprotected copy. In Python, call reader.decrypt("password") on a pypdf PdfReader before accessing pages.