slimpdf

Get a PDF under a size limit without uploading it to a website. It runs on your machine — no account, no cloud, no network calls.

pip install slimpdf
slimpdf compress big-scan.pdf --target 3mb -o small.pdf

Why slimpdf?

Most online PDF compressors upload your file to a server first. That's fine for a flyer, less fine for a medical bill or an ID document. slimpdf does the whole thing locally, so the file never leaves your computer.

🔒 Private & offline

No uploads, no cloud, no telemetry. Safe for medical, legal, and financial files.

🎯 Target-size aware

--target 3mb finds the gentlest compression that meets your limit.

🛡️ Never corrupts

Validates every result; leaves a file untouched if it can't help. Never bloats.

⚖️ MIT-licensed

Permissive deps only — embeddable even in closed-source apps. No AGPL.

Benchmarked against Ghostscript

On real documents, slimpdf matches Ghostscript's compression at higher visual fidelity — and hits the size target reliably without quality cliffs.

EngineAvg % smallerVisual fidelity (SSIM)
slimpdf (target 3 MB)79%0.991
Ghostscript /ebook80%0.979
Ghostscript /screen91%0.956

Higher SSIM = closer to the original. slimpdf preserves more quality at comparable size.

Usage

# Compress below a target size
slimpdf compress input.pdf --target 3mb -o output.pdf

# Inspect a PDF (pages, images, text layer, encryption)
slimpdf inspect input.pdf

# Batch a whole folder
slimpdf batch ./folder --target 3mb --out ./compressed

Python API: from slimpdf import compress, CompressOptions

FAQ

How do I compress a PDF without uploading it?
Run slimpdf compress file.pdf --target 3mb — it's fully local.

Is it safe for confidential documents?
Yes — no network calls, nothing stored. Built for sensitive files.

Does it work offline?
Completely.