Skip to content
yutils
Example

Input

File: photos.pdf (380 KB, four 2000×1400 JPEGs)
Options: Downsample images on · Strip metadata on

Output example (4 photos · 2000×1400 JPEG — measured)

Source 380 KB → Compressed 172 KB (55% saved)
4/4 JPEG images re-compressed (2000px → 1600px)

Note

Results vary by composition — high-res JPEG-heavy PDFs shrink the most, text-heavy 5-20%, PNG-style (FlateDecode) near 0%.

Usage / FAQ

When to use

  • Trim a PDF that's just over an email attachment cap (10-25 MB)
  • Clean up inefficient PDFs from legacy tools (re-encoding effect)
  • Strip metadata (author / company / software) before external sharing
  • Diagnose why a PDF is unexpectedly large (estimate via the difference)
  • First step when batch-cleaning many PDFs (then pdf-merge, etc.)

FAQ

Q.Why do some PDFs barely shrink?
A.This tool only downsamples JPEG (DCTDecode) images. PNG-style (FlateDecode) / JPEG2000 images are left untouched, and JPEGs already at or below 1600px (or that would not get smaller) keep their originals — PDFs built that way see small gains.
Q.Does stripping metadata help security?
A.Partially — removes forensic clues like author / company / source software. But other clues (image EXIF, text layout fingerprints) remain. For real sanitization, print-to-PDF + OCR is the canonical path.
Q.Can the output be larger than the input?
A.Yes — for well-compressed PDFs (modern Acrobat output) the naive re-encoding here can slightly inflate. In that case the 'before > after' difference appears negative.
Fun facts
  • PDF's object stream compression entered with PDF 1.5 (2003). Earlier (1.4 and below) every object was its own stream; from 1.5, many objects can be packed into one compressed stream — meaningful size reduction.

    ISO 32000-1 §7.5.7 (Object Streams)
  • 80-95% of a typical PDF's weight is images — text barely contributes. So the real answer for 'shrink my PDF' is image down-sampling. 300dpi → 150dpi alone often halves the size.

    Wikipedia — PDF Compression
  • Ghostscript's -dPDFSETTINGS=/ebook (or /screen) is the canonical compression preset — automatically down-samples images + subsets fonts + applies object streams. The standard CLI trick.

    Ghostscript — PDF settings