PDFly · Blog

How to Compress a PDF: What Actually Shrinks the File

Two PDFs, same page count, and one is ten times the size of the other. That's almost never about how much text is in the document — it's almost always about what's embedded in it, and how efficiently the file itself is packaged. Here's what actually determines a PDF's size, what PDFly's Compress PDF tool does and doesn't do about it, and the real workflow for the cases it can't fix on its own.

Why PDFs get large

A PDF is a container, and most of its weight comes from what's packed inside that container rather than the container itself:

  • Images. Photos, scanned pages, logos, and charts embedded at full resolution are by far the most common cause of a bloated PDF. A single high-resolution photo can outweigh fifty pages of plain text.
  • Scanned pages. A scanned document is really just a sequence of embedded page images — there's no separate "text" to speak of, so the file's size is almost entirely a function of image size and scan resolution.
  • Embedded fonts. Fonts embedded to guarantee consistent rendering add real weight, especially with several typefaces or weights in one document.
  • Leftover structural bloat. A PDF that's been edited, merged, or re-saved repeatedly often accumulates duplicate objects, unused resources, and inefficient internal formatting — none of which is visible, all of which adds bytes.

What PDFly's Compress PDF tool actually does

PDFly's Compress PDF tool runs entirely in your browser and performs lossless structural compression: it rebuilds the PDF's internal object table, removes duplicate objects and leftover data from previous edits, and — on Medium and High settings — rewrites that table using compressed object streams, a more compact format PDF has supported since version 1.5. This doesn't touch a single pixel in your images or re-encode a single font, so there's no quality to lose. Form fields, hyperlinks, and bookmarks are preserved.

It's worth being precise about what this is not: it's not lossy compression. Lossy compression discards detail to shrink a file further — typically by re-encoding a JPEG at a lower quality setting or reducing its pixel dimensions. Desktop editors like Acrobat can do this; PDFly's in-browser engine doesn't perform it today. That has a direct consequence: if a PDF's size is dominated by its images rather than its structure, lossless compression alone will only get you so far.

Low, Medium, and High — what the levels actually change

  • Low: skips the object-stream rebuild, for maximum compatibility with older PDF readers.
  • Medium: rebuilds the file using compressed object streams. This is the recommended default for most documents.
  • High: currently applies the same structural rebuild as Medium. It's reserved for stronger, image-aware compression as the engine develops — so today, Medium and High will typically produce the same result.

Why a scanned PDF barely shrinks

This is the single most common source of disappointment with any PDF compressor, not just PDFly's. A scanned document is almost entirely embedded page images — there's no bloated object table or duplicate metadata to trim, because the file was never large for structural reasons in the first place. Structural compression can't shrink an image it doesn't touch.

If a scanned PDF genuinely needs to be smaller, the real lever is the images, not the wrapper around them. Two workflows actually move the needle:

  • Scan at a lower resolution to begin with. 150–200 DPI is plenty for on-screen reading; reserve 300 DPI for documents that will be printed.
  • For a PDF you already have: pull the pages out with Extract Images, shrink them with Image Compressor, and rebuild the PDF with JPG to PDF. If you also need the text searchable afterward, run OCR PDF on the result.

How to check the result before you send it

Structural compression is lossless, so there's no visual check required for quality — the pixels and fonts are untouched. What's worth checking instead:

  • Confirm the file actually got smaller. If the reduction is under 1%, PDFly shows "Optimized" rather than a misleading rounded-to-zero percentage — that's expected on files that were already efficiently structured.
  • If you compressed a password-protected PDF directly without removing the password first, verify the result opens correctly — encrypted files can produce a corrupted output. Unlock PDF first if that applies to you.
  • For scanned or image-heavy files, check whether the reduction met your expectations before assuming the tool failed — see the section above.

When compression isn't the answer

Sometimes file size isn't actually the problem to solve. If you're sharing through a cloud drive or a document platform rather than an email attachment, large files often aren't an issue at all. And if a document's size comes from genuinely necessary high-resolution images — a print-bound design file, for instance — compressing it defeats the purpose. Keep the original for anything where quality has to survive intact, and compress a copy for the version that actually needs to travel light.

Email attachment limits

Most major email providers cap attachments around 25MB. Structural compression can meaningfully shrink a document-heavy, frequently-edited PDF, but it won't rescue a file that's oversized purely because of its images — for that, the Extract Images → Image Compressor → JPG to PDF workflow above, or a shared link instead of an attachment, will get you further.

Frequently Asked Questions

Does compressing a PDF reduce image quality?

Not with PDFly's compressor. It rebuilds the PDF's internal structure losslessly and doesn't re-encode or downsample embedded images, so there's no visible quality loss. For pixel-level image compression, use Image Compressor on the images themselves.

Why didn't my scanned PDF get much smaller?

Scanned PDFs are almost entirely made up of embedded page images. Structural compression only rebuilds the document's object table, so it can't shrink the images that make up most of a scanned file's size.

What's the difference between Low, Medium, and High compression?

Low skips the object-stream rebuild for maximum compatibility with older PDF readers. Medium rebuilds the file using compressed object streams and is the recommended default. High currently applies the same structural rebuild as Medium and is reserved for stronger, image-aware compression as PDFly's engine develops.

Is my file uploaded to a server when I compress it?

No. PDFly's Compress PDF tool runs entirely in your browser using the pdf-lib library. Your file is read, compressed, and made available for download without ever being sent anywhere.

Can I compress a password-protected PDF?

Remove the password first with Unlock PDF. Compressing an encrypted file directly can produce a corrupted or unreadable result.

A

Ayaz