pdfblah.com

← All guides

Compress a PDF to an exact size

The upload form says 200 KB maximum and rejects your 34 MB scan. Most compressors offer "low, medium, high" and a shrug. compress takes the number itself: give it a hard target and it works down a quality ladder until the file fits, or tells you plainly that it can't.

Local and free. Part of the open source pdfblah CLI; nothing is uploaded. Your 34 MB of payslips and IDs never leave your machine on their way to 200 KB.

What it actually does

How to do it

pip install "pdfblah[app]"

# the portal says 200 KB
pdfblah compress in.pdf -o out.pdf --target 200kb

# no hard cap, just smaller (150 dpi, quality 75)
pdfblah compress in.pdf -o out.pdf

# choose the trade-off yourself
pdfblah compress in.pdf -o out.pdf --dpi 100 --quality 60 --grayscale

A real run: compressed: 11870 KB -> 150 KB (98.7% smaller, images at 100 dpi / q55, 1 recompressed, 0 kept). On a miss you get smallest achievable with the text layer kept is 412 KB (target 200 KB) instead of a silently broken file.

Make it a right-click on your Mac

One command installs a Finder Quick Action called Shrink PDF:

curl -fsSL https://pdfblah.com/compress-mac.sh | sh

Select PDFs, right-click, Quick Actions → Shrink PDF. Smaller copies land in ~/Downloads/compressed as name-small.pdf.

Tips