Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

Repository files navigation

📄 pdfkit — Free PDF Toolkit

Stop paying for Adobe Acrobat, SmallPDF, and iLovePDF.

pdfkit is a 100% free, offline CLI tool for:

  • Merge multiple PDFs into one
  • Split PDFs by page ranges
  • Extract specific pages
  • Compress PDF file sizes
  • Rotate pages
  • Extract text from PDFs
  • Images → PDF conversion
  • PDF → Images conversion
  • Watermark PDFs
  • Encrypt/Decrypt with passwords
  • Metadata viewing/editing

Everything runs locally. No uploads. No limits. No watermarks on your watermarks.

Why?

Service Free Tier pdfkit
SmallPDF 2 tasks/day Unlimited forever
iLovePDF Limited, ads No ads, no limits
Adobe Acrobat $23/month $0 forever
ILovePDF API 250 files/month Unlimited forever
PDF24 Desktop only CLI + Python API

Quick Start

pip install pdfkit

# Merge PDFs
pdfkit merge file1.pdf file2.pdf -o combined.pdf

# Split by pages
pdfkit split input.pdf --pages 1-5,8,10-12 -o output/

# Extract specific pages
pdfkit extract input.pdf --pages 3,5,7 -o extracted.pdf

# Compress
pdfkit compress input.pdf -o compressed.pdf --quality medium

# Rotate pages
pdfkit rotate input.pdf --angle 90 --pages all -o rotated.pdf

# Extract text
pdfkit text input.pdf

# Images to PDF
pdfkit img2pdf *.jpg -o photos.pdf

# PDF to images
pdfkit pdf2img input.pdf -o output/ --format png

# Add watermark
pdfkit watermark input.pdf --text "DRAFT" -o watermarked.pdf

# Encrypt
pdfkit encrypt input.pdf --password secret123 -o protected.pdf

# Get info
pdfkit info input.pdf

Features

  • 100% offline — No data ever leaves your machine
  • No limits — Process as many files as you want
  • No watermarks — Unlike "free" online tools
  • Fast — Pure Python, no cloud roundtrips
  • Scriptable — Perfect for automation and agents
  • Cross-platform — Linux, macOS, Windows

Deployment

Deploy with one click to cloud platforms:

Deploy to Railway Deploy to Render

Or use Docker:

docker build -t pdfkit .
docker run --rm -v $(pwd):/data pdfkit merge /data/a.pdf /data/b.pdf -o /data/combined.pdf

Commands

merge — Combine multiple PDFs

pdfkit merge a.pdf b.pdf c.pdf -o combined.pdf
pdfkit merge *.pdf -o all-in-one.pdf --bookmark

split — Split PDF into parts

# By page ranges
pdfkit split input.pdf --pages 1-5,6-10 -o parts/

# Every N pages
pdfkit split input.pdf --every 2 -o chunks/

# Into single pages
pdfkit split input.pdf --single -o pages/

extract — Extract specific pages

pdfkit extract input.pdf --pages 1,3,5-8 -o extracted.pdf

compress — Reduce file size

pdfkit compress input.pdf -o smaller.pdf
pdfkit compress input.pdf -o small.pdf --quality low    # Aggressive
pdfkit compress input.pdf -o small.pdf --quality high   # Minimal

rotate — Rotate pages

pdfkit rotate input.pdf --angle 90 -o rotated.pdf
pdfkit rotate input.pdf --angle 180 --pages 1,3,5 -o partial.pdf

text — Extract text content

pdfkit text input.pdf                    # Print to stdout
pdfkit text input.pdf -o text.txt        # Save to file
pdfkit text input.pdf --pages 1-5        # Specific pages

img2pdf — Convert images to PDF

pdfkit img2pdf photo1.jpg photo2.png -o photos.pdf
pdfkit img2pdf scans/*.png -o document.pdf --page-size a4

pdf2img — Convert PDF to images

pdfkit pdf2img input.pdf -o output/
pdfkit pdf2img input.pdf -o output/ --format jpg --dpi 300

watermark — Add watermark

pdfkit watermark input.pdf --text "CONFIDENTIAL" -o marked.pdf
pdfkit watermark input.pdf --stamp watermark.pdf -o marked.pdf
pdfkit watermark input.pdf --text "DRAFT" --opacity 0.3 -o marked.pdf

encrypt/decrypt — Password protection

pdfkit encrypt input.pdf --password secret -o protected.pdf
pdfkit decrypt protected.pdf --password secret -o unlocked.pdf

info — View PDF metadata

pdfkit info input.pdf
# Output:
# Title: My Document
# Author: John Doe
# Pages: 42
# Size: 1.2 MB
# Encrypted: No

Python API

from pdfkit import PDFMerger, PDFSplitter, PDFExtractor

# Merge
merger = PDFMerger()
merger.merge(["a.pdf", "b.pdf"], "combined.pdf")

# Split
splitter = PDFSplitter("input.pdf")
splitter.split_by_ranges({"part1": (1, 5), "part2": (6, 10)}, "output/")

# Extract text
extractor = PDFExtractor("input.pdf")
text = extractor.get_text()
print(text)

Use Cases

For Developers

  • Automate document processing in CI/CD
  • Batch process reports
  • Generate documentation PDFs

For AI Agents

  • Extract text from PDFs for LLM processing
  • Split large PDFs for context windows
  • Compress PDFs before sharing

For Everyone

  • Merge scanned pages into one document
  • Add watermarks to contracts
  • Protect sensitive documents with passwords
  • Convert images to PDF for submissions

System Requirements

  • Python 3.8+
  • ~10MB disk space
  • No external dependencies (pure Python with pypdf)

Contributing

We need help with:

  • GUI version
  • Batch mode improvements
  • More compression options
  • OCR integration
  • Form filling

License

MIT — Free forever. No catch.


Built because PDF manipulation shouldn't cost money.

Built because PDF manipulation shouldn't cost money.

Made with 🦀 by Thielon | https://github.com/RanaPriyansh

About

Free PDF Toolkit — Merge, split, extract, compress, rotate, watermark, encrypt PDFs. 100% offline, no limits.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages