Tools

PDF Compression: How to Reduce PDF File Size Without Losing Quality

ZeroPhantom 2026-01-29 4 min read

A 50MB PDF presentation shouldn't be 50MB. Here's how to reduce PDF file size by 50–90% depending on content type.

Quick Online Method

Upload to ZeroPhantom's converter and use the PDF optimize option. Typically reduces size by 40–70% for image-heavy PDFs. Free, no signup.

What Actually Makes PDFs Large

  • Uncompressed or high-resolution embedded images (biggest culprit)
  • Embedded fonts (especially all-glyphs instead of subset)
  • Redundant metadata and annotations
  • Uncompressed vector graphics

Python Compression (PyMuPDF / fitz)

import fitz  # pip install pymupdf

def compress_pdf(input_path, output_path, image_quality=60):
    doc = fitz.open(input_path)
    for page in doc:
        for img in page.get_images():
            xref = img[0]
            pix = fitz.Pixmap(doc, xref)
            if pix.n >= 5:  # CMYK
                pix = fitz.Pixmap(fitz.csRGB, pix)
            doc.update_stream(xref, pix.tobytes('jpeg', jpg_quality=image_quality))
    doc.save(output_path, garbage=4, deflate=True, clean=True)
    doc.close()

Ghostscript (Command Line)

gs -dBATCH -dNOPAUSE -dCompatibilityLevel=1.4    -dPDFSETTINGS=/ebook    -sDEVICE=pdfwrite -sOutputFile=compressed.pdf input.pdf

PDFSETTINGS options: /screen (smallest, lowest quality), /ebook (72dpi, good balance), /printer (300dpi), /prepress (highest quality).

Realistic Expectations

  • Image-heavy PDFs (scans, presentations): 50–90% reduction
  • Text-only PDFs: 5–20% reduction
  • Already-compressed PDFs: minimal improvement
Compress PDF free — no signup →
ZeroPhantom Support AI-Powered · Usually replies instantly
👋 Hi there! Let's chat.
Fill in your details to get started.
ZeroPhantom Support