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
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.
No uploads, no cloud, no telemetry. Safe for medical, legal, and financial files.
--target 3mb finds the gentlest compression that meets your limit.
Validates every result; leaves a file untouched if it can't help. Never bloats.
Permissive deps only — embeddable even in closed-source apps. No AGPL.
On real documents, slimpdf matches Ghostscript's compression at higher visual fidelity — and hits the size target reliably without quality cliffs.
| Engine | Avg % smaller | Visual fidelity (SSIM) |
|---|---|---|
| slimpdf (target 3 MB) | 79% | 0.991 |
| Ghostscript /ebook | 80% | 0.979 |
| Ghostscript /screen | 91% | 0.956 |
Higher SSIM = closer to the original. slimpdf preserves more quality at comparable size.
# 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
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.