Compression

How to Compress a PDF Without Losing Quality

ยทUpdated ยท9 min read

A PDF that is too large to email or too slow to upload is one of the most common document headaches. The good news: most oversized PDFs can be made dramatically smaller with little or no visible quality loss, once you understand what is taking up the space.

Why PDFs get large

In the vast majority of cases, file size comes from images. A page of plain text adds only a few kilobytes, but a single high-resolution photo or scanned page can add several megabytes. PDFs created by scanners are essentially a stack of images, which is why they tend to be the largest files of all.

Other contributors include embedded fonts, duplicated resources, and metadata, but images are almost always the dominant factor. This is the key insight behind compression: shrink the images intelligently and the file shrinks with them.

There is a quick way to confirm this for your own file. Divide the file size by the page count. A text-only report will land somewhere around 30 to 100 KB per page. Anything above roughly 500 KB per page means images are doing the damage, and compression will almost certainly help. A 40-page file at 60 MB works out to 1.5 MB per page. That is a scan, whatever its name suggests.

How much smaller will the file get?

Reduction depends far more on what is inside the PDF than on the setting you pick. Rough expectations for the Ebook preset, which is the one most people should use:

  • Scanned documents usually come out 70 to 90% smaller. Scans are the best case by a wide margin, because scanners save images at far higher resolution than anyone needs for reading.
  • Presentations and reports with photos tend to drop 40 to 70%, depending on how many images there are and how big they were to begin with.
  • Text documents exported from Word or Google Docs often shrink only 5 to 15%. There was very little to remove in the first place.
  • PDFs that have already been compressed sometimes do not shrink at all, because the images were downsampled once already.

If your file falls into that last group and you were expecting a large drop, the tool is not failing. It is telling you the file was already close to as small as it can usefully get.

What the four compression presets do

CocoPDF's Compress PDF tool runs an engine built for professional print workflows. It offers four standard presets, each tuned for a different purpose:

  • Screen is the most aggressive setting, downsampling images to 72 DPI. Best for files that will only ever be viewed on a screen or shared by email.
  • Ebook is the balanced setting at 150 DPI. It is the right choice for most documents, and text and images stay crisp on screen.
  • Printer works at 300 DPI. Use it when the PDF will be printed on a normal office printer.
  • Prepress also runs at 300 DPI but preserves color information. It is the gentlest setting, intended for professional printing where quality must not be compromised.

Which setting should you choose?

Start with Ebook. For the great majority of documents it produces a file that is much smaller while remaining visually indistinguishable from the original. Only drop to Screen if you need the absolute smallest file and the document will never be printed. Move up to Printer or Prepress when print quality matters more than file size.

One question decides it faster than any other: will this document ever be printed? If the answer is no, and it is going to a mailbox or a portal to be read on screen, then Ebook or Screen is right and Printer is wasted size. If the answer is yes, or even maybe, stay at Printer. Reprinting a document that came out soft is far more annoying than sending a slightly larger file.

What downsampling does

The presets are described in DPI, or dots per inch, and that number is the whole mechanism. An image inside a PDF has a fixed pixel count, and the page places it in a fixed physical space. Divide one by the other and you get the effective DPI. A photo 3000 pixels wide placed across a 6-inch column is being displayed at 500 DPI.

No screen and almost no office printer can reproduce that. Compression discards the pixels that were never going to be visible, resampling the image down to 150 DPI for Ebook or 300 DPI for Printer. The image really is losing data, which is why this is called lossy compression. The data it loses was not doing any work.

This is also why the reduction is so uneven between files. Compression only has something to remove when the original resolution exceeded what the page needed. An image already sitting at 150 DPI passes through the Ebook preset essentially untouched.

What compression does not affect

Text in a PDF is stored as vector data, not as an image, so it stays perfectly sharp at every compression level. Compression changes image resolution. It does not blur your words, which is why even the Screen preset keeps documents readable.

The same applies to anything else stored as vectors: logos saved as vector art, charts exported from a spreadsheet, and line drawings all stay crisp. Page count, page dimensions, and the reading order of the document are untouched. Form fields, hyperlinks, and the text layer added by OCR survive compression as well, so a searchable scan stays searchable.

Scanned PDFs need a bit more care

Scans compress the most, but they are also where quality problems show up, because on a scan the text is part of the image. Vector text is immune to downsampling. Scanned text is not. Push a scan to the Screen preset and small print can turn mushy at the exact moment someone needs to read it.

For scanned text documents, Ebook is the sensible floor. It leaves enough resolution for body text to stay legible while still cutting most of the bulk. If the scan contains fine print, handwriting, signatures, or anything a reader might need to zoom into, use Printer instead and accept the larger file.

There is also an ordering question. Run OCR first, then compress. OCR reads the image to build the text layer, so it does its most accurate work on the higher-resolution original. Compressing first hands the OCR engine a degraded image and you get a worse text layer for no benefit.

Hitting a specific size limit

Most compression happens because something imposed a cap. The common ones are worth knowing, because they determine how hard you need to push:

  • Gmail allows 25 MB per message including attachments. Larger files get turned into Drive links automatically.
  • Outlook and Microsoft 365 default to 20 MB for internet email, and plenty of corporate servers are set lower than that.
  • Government and university upload portals frequently cap at 5 MB or 10 MB, usually with no explanation when a file is rejected.
  • Job application systems commonly allow 2 MB to 5 MB for a CV or portfolio.

Aim comfortably under the limit rather than just beneath it. Email attachments are encoded for transport, which inflates them by roughly a third on the wire, so a 24 MB file can still be refused by a 25 MB cap. Treat the stated limit as about three quarters of what it says and you will not need a second attempt.

When compression will not help

Sometimes the size is not coming from image resolution, and no preset will fix it. Look for these cases before compressing a third time:

  • The file is mostly pages you do not need. Removing them with Remove Pages, or pulling out just the section you want with Extract Pages, will beat any compression setting.
  • The PDF has embedded attachments, or an embedded font set for a language you are not using. These are structural, and compression leaves them alone.
  • The file has already been compressed. A second pass gives you very little and slowly degrades the images.
  • The document is genuinely enormous. A 600-page manual with a photo on every page is a large document, and the better fix is to split it with Split PDF.

Practical tips

  • If a compressed file is still too large, the original images were probably enormous. Consider whether the document needs to be a scan at all.
  • Compress once. Repeatedly compressing an already-compressed PDF gives diminishing returns and can introduce visible artifacts.
  • For scanned documents you also want to search, run OCR as well as compression, not instead of it.
  • Keep the original. Compression is not reversible, and the discarded pixels cannot be recovered from the smaller file.
  • Check the result before sending it. Open the compressed PDF and zoom to 100% on the most detailed page, which is where any problem shows up first.
  • If you scan the document yourself, scan at 300 DPI rather than 600. You will get a smaller file from the start and lose nothing that matters for a text document.

The order to do things in

For an oversized PDF, the sequence that avoids wasted effort is: remove any pages you do not need, run OCR if it is a scan you need to search, then compress at Ebook and check the result at 100% zoom. If it is still over the limit, drop to Screen when the document is screen only, or split it when it is not. Working in that order means you only give up quality after the free changes have run out.

To try it yourself, upload your file to the Compress PDF tool, pick a quality level, and download the result. Processing happens on the server in seconds, and the file is deleted within an hour.

Try it yourself

Everything in this article is free to use on CocoPDF, with no account needed.

๐Ÿ—œ๏ธ Compress PDF