npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@joemccann/pi-pdf

v1.0.1

Published

PDF manipulation, processing, and management toolkit for Pi coding agent — extract text/tables, merge/split, fill forms, create PDFs, OCR, watermark, encrypt/decrypt, and more

Readme

pi-pdf

PDF manipulation, processing, and management toolkit for Pi coding agent.

Features

  • Extract text from PDFs with layout preservation
  • Extract tables as structured data
  • Merge multiple PDFs into one
  • Split PDFs into individual pages or ranges
  • Rotate pages by 90°, 180°, or 270°
  • Add watermarks (text overlay on all pages)
  • Encrypt PDFs with password protection
  • Decrypt password-protected PDFs
  • Fill PDF forms (fillable fields and annotation-based)
  • Convert PDFs to images for visual analysis
  • OCR scanned PDFs (with pytesseract)
  • Get PDF metadata (title, author, page count, encryption status)

Installation

pi install npm:@joemccann/pi-pdf

Or for project-local installation:

pi install -l npm:@joemccann/pi-pdf

Prerequisites

Requires Python 3.9+ with these packages:

pip install pypdf pdfplumber reportlab

Optional (for OCR and image conversion):

pip install pdf2image pytesseract pypdfium2 Pillow

Optional CLI tools:

# macOS
brew install poppler qpdf

# Ubuntu/Debian
apt install poppler-utils qpdf

Check all dependencies:

node scripts/check-deps.js

What's Included

Extension Tools (10 tools)

The LLM can call these tools directly:

| Tool | Description | |------|-------------| | pdf_info | Get metadata, page count, encryption & form-field status | | pdf_extract_text | Extract text from pages with layout preservation | | pdf_extract_tables | Extract structured table data | | pdf_merge | Merge multiple PDFs into one | | pdf_split | Split a PDF into pages or ranges | | pdf_rotate | Rotate pages by 90/180/270 degrees | | pdf_encrypt | Password-protect a PDF | | pdf_decrypt | Remove password protection | | pdf_watermark | Add text watermark overlay | | pdf_to_images | Convert pages to PNG images | | pdf_form_fields | Extract fillable form field info | | pdf_fill_form | Fill in PDF form fields |

Skill

The pdf skill provides comprehensive PDF processing guidance that the agent loads on-demand when working with PDF files. It covers:

  • All Python libraries (pypdf, pdfplumber, reportlab, pypdfium2)
  • JavaScript libraries (pdf-lib, pdfjs-dist)
  • CLI tools (qpdf, pdftotext, pdftk)
  • Form filling workflows (fillable and non-fillable PDFs)
  • Advanced reference documentation

Usage Examples

Just ask Pi to work with PDFs naturally:

"Extract the tables from invoice.pdf"
"Merge report1.pdf, report2.pdf and report3.pdf into combined.pdf"
"Split this 50-page PDF into chunks of 10 pages"
"Add a CONFIDENTIAL watermark to the document"
"Password-protect the contract PDF"
"Fill out this tax form with my information"
"How many pages are in this PDF?"

Testing

# Run all tests
npm test

# Run unit tests only
npm run test:unit

# Run integration tests only
npm run test:integration

Project Structure

pi-pdf/
├── package.json              # Pi package manifest
├── README.md
├── LICENSE
├── extensions/
│   └── index.ts              # Extension tools (pdf_info, pdf_merge, etc.)
├── skills/
│   └── pdf/
│       ├── SKILL.md           # Main skill file with usage guide
│       ├── REFERENCE.md       # Advanced reference documentation
│       ├── FORMS.md           # Form filling workflow guide
│       └── scripts/           # Python helper scripts
│           ├── check_bounding_boxes.py
│           ├── check_fillable_fields.py
│           ├── convert_pdf_to_images.py
│           ├── create_validation_image.py
│           ├── extract_form_field_info.py
│           ├── extract_form_structure.py
│           ├── fill_fillable_fields.py
│           └── fill_pdf_form_with_annotations.py
├── scripts/
│   └── check-deps.js         # Dependency checker
└── tests/
    ├── fixtures/              # Test PDF files
    ├── unit/                  # Unit tests
    └── integration/           # Integration tests

License

MIT