Make PDFs smaller with lossless compression.

Losslessly recompress your existing archive on the PyMuPDF stack you already run. No migration. No new format. Just a smaller bill.

Text stays text. Images stay images. We just pack it tighter.

PDF compression
For developers

One parameter. No migration.

Recompress existing PDFs with doc.save() and choose from multiple compression options without changing your workflow.

1234567891011
import pymupdf

doc = pymupdf.open("archive.pdf")
doc.save(
    "compressed.pdf",
    use_objstms=True,
    deflate=1,
)
doc.close()

Compress with Flate.

Compresses the packed streams with standard Flate, the same algorithm used in ZIP files. Supported by every PDF viewer and tool.

READ THE DOCS
Compression result

What each option actually does.

A 1.8MB test file, compressed with each setting below.

Description
File size
Reduction
Comments
Original file
1.8 MB
use_objstms=True
1.5 MB
~17%
use_objstms=Truedeflate=1
903 KB
~51%
use_objstms=Truedeflate=2
863 KB
~53%
Limited supportThis compression uses Brotli, which is experimental and some tools might not support it.
use_objstms=Truedeflate=2compression_effort=100
834 KB
~55%
Limited supportThis compression uses Brotli, which is experimental and some tools might not support it.
use_objstms=Truedeflate=2compression_effort=100garbage=4
831 KB
~55%
Limited supportThis compression uses Brotli, which is experimental and some tools might not support it.
Why this matters

Doesn't sound like much. Until it's everything you've got.

Small savings per file look trivial in isolation. They stop being trivial the moment you multiply by everything you've ever stored.

A few MB saved

1 PDF

Gigabytes saved

10,000 PDFs

Terabytes saved

1,000,000 PDFs

Petabytes saved

Billions of PDFs

For infrastructure & IT teams

What's this actually costing you?

Not a quote. A gut check. Plug in your numbers, then talk to us for the real benchmark.

1,000,000
10 MB
$
Defaults to AWS S3 Standard pricing. Edit to match your provider.

How this is calculated: assumes a 45% average size reduction, the low end of the 50 to 58% range measured in our own benchmarks above. Your real ratio depends on document mix (scanned images compress less than vector or text).

Estimated savings per year

$1,213

Before

9,765.6 GB

After

5,371.1 GB

Want the real number instead of a guess? Talk to us about your document mix.

CONTACT US

Trusted by leading document infrastructure teams for 30+ years

Small is beautiful,
at every scale.

Compress a file today.

PyMuPDF Logo

© 2026 Artifex Software Inc. All rights reserved.