Why PDF compression sometimes fails
Already-compressed images, special codecs, fonts, vectors and files that grow
The common reasons a PDF refuses to get smaller – images that are already compressed, JPEG 2000, JBIG2 and fax encodings, embedded fonts, vector-heavy pages, encryption – and what to try instead of compressing harder.
- By HelpMeJPG editorial team
- Published
- Updated
- 10 min read
On this page
Quick answer: PDF compression fails when the file contains nothing a compressor can safely remove. The bytes may already be highly compressed (JPEGs saved at low quality, JPEG 2000, JBIG2 or fax-encoded scans), they may be fonts or vector drawings that cannot be shrunk without changing the document, or the file may be encrypted so its contents cannot be read. In each case the fix is not a stronger setting but a different approach: regenerate the file at the source, split it, or accept that it is already as small as it will get.
Compression can only remove what is there
A PDF compressor has two honest levers. It can rewrite the file structure more compactly – packing object dictionaries into object streams, dropping superseded objects left behind by earlier saves, removing stored page thumbnails and optional metadata. And it can re-encode raster images with fewer pixels and stronger JPEG compression. Text, fonts and vector graphics are never converted to pixels, because that would destroy searchability and crispness.
Everything that follows is a consequence of those limits. When the Compress PDF tool reports that a file came out the same size or larger, it is not malfunctioning: it has looked at every object in the file, found nothing it could legitimately shrink, and is telling you so rather than handing you a degraded file with a made-up percentage. The report beneath the result lists how many images were found, re-encoded and skipped, with a note explaining each kind of skip. Read that first; it usually names the cause directly.
Images that are already compressed
The most frequent cause is simply that someone got there first. A JPEG saved at a modest quality has already had its fine detail rounded away; re-encoding it at a similar quality cannot remove much more, and re-encoding it at a higher quality would make it larger, because the encoder would faithfully preserve the previous pass's artefacts. The compressor only keeps a re-encoded image when the new version is meaningfully smaller – otherwise the original bytes stay, so a photograph is never degraded for a saving of a few hundred bytes.
Downsampling, the other lever, only applies when an image has more pixels than the profile allows. The Balanced profile caps images at 1,800 pixels on the long edge, roughly 150 pixels per inch on an A4 or Letter page; a smaller image is not scaled at all. A document whose images were exported "for screen" is therefore already below the threshold, and the only remaining lever is quality. Very small images – icons, bullets, logos of a few kilobytes – are skipped entirely because the saving would be negligible and the visible damage would not.
The practical test: if the report shows most images skipped and the re-encoded ones saving little, the images are already efficient. A stronger profile lowers the cap and the quality and may buy a little more, at a visible cost; the guide to reducing PDF file size sets out what each profile does.
A before and after example
Two 20-page documents of similar size show the difference. The figures are illustrative; the pattern is what matters:
| Document | Before | After Balanced | Why |
|---|---|---|---|
| Report with 20 full-resolution phone photos | 48 MB | 5–8 MB | Each 4032-pixel photo is downsampled to 1,800 pixels and re-encoded |
| Report whose images were already exported for screen | 6 MB | 5.5–6 MB | Images are under the cap and already compressed, so most are skipped |
The first file had pixels to give up; the second did not. Running the second through a stronger profile would buy a little more at a visible cost – the report's count of skipped images tells you which case you are in before you try.
Codecs a browser cannot safely re-encode
PDF allows images to be stored with several compression schemes, and only some can be decoded and re-encoded safely with what a browser offers. The compressor handles JPEG (the DCTDecode filter) and uncompressed or Flate-compressed RGB and greyscale images – the forms that account for nearly all photographs and colour scans. Everything else is left exactly as it was and reported.
| Encoding in the PDF | Where it comes from | Why it is left alone | What to try |
|---|---|---|---|
| JPEG 2000 (JPXDecode) | Scanning software, archive systems, PDF/A workflows, some cameras | Wavelet-based and already efficient; no browser encoder exists, and converting to JPEG would usually not save much | Leave it, or regenerate the PDF from the scanner with ordinary JPEG output |
| JBIG2 (JBIG2Decode) | Black-and-white document scanners and OCR suites | Designed for bi-level text scans and extremely compact; re-encoding as JPEG would make text grey, fuzzy and larger | Nothing – a JBIG2 scan is close to the smallest a page can be |
| CCITT Group 3/4 (CCITTFaxDecode) | Fax machines, older scanners, multifunction copiers | Also bi-level and compact; the same JPEG problem applies | Nothing, unless the scan resolution is far higher than needed |
| CMYK and indexed colour | Print-ready PDFs; palette images from graphics tools | Converting CMYK in a browser shifts colours; indexed images are usually small already | Export an RGB version from the design application for screen use |
| 16-bit images, custom decode arrays, stencil masks | Scientific imaging, some design exports | The browser canvas cannot preserve the extra precision or the special handling | Regenerate at 8 bits per channel if the precision is not needed |
Two of these look like a failure and are actually a success. JBIG2 and CCITT Group 4 are the formats behind the remarkably small black-and-white scans that come out of office copiers. They encode runs of black and white pixels, and JBIG2 additionally recognises repeated symbols such as letters and stores each shape once. A compressor that re-encoded those pages as JPEG would produce grey, smeared text in a bigger file, so skipping them is the correct decision.
JPEG 2000 is the subtler case. It compresses photographs and colour scans more efficiently than classic JPEG at the same quality, so re-encoding it as JPEG rarely helps unless the image is also downsampled heavily. If such a file is too large, the resolution of the original scan is the problem, not the codec.
Files that are mostly fonts
A PDF embeds the font programs it uses so the document looks the same everywhere. Well-behaved producers embed only the glyphs actually used – a subset – which keeps each font to a few tens of kilobytes. Some embed entire fonts: a single complete East Asian font can run to several megabytes, and a form with dozens of field appearances may embed the same font many times over.
No image compression touches this. The compressor cannot subset fonts, because doing it safely means parsing every font format PDF allows and rewriting glyph tables, and a mistake corrupts the text on every page. If the PDF metadata viewer shows the file came from a design or office application and the compressor reports few images, fonts are the likely culprit. The fix lives upstream: re-export from the source with "subset fonts" or "embed only used characters" switched on. Those bytes cannot be recovered from the finished file in a browser.
Vector-heavy documents
Maps, engineering drawings, architectural plans and charts with thousands of data points are drawn, not photographed. Their bulk is in content streams – long lists of path and fill instructions – and those streams are already Flate-compressed when the file is written. A compressor cannot make them smaller without altering the drawing, and turning the pages into images would produce a larger, less useful file in every case except a low-resolution preview, besides destroying selectable text. The tool never rasterises pages for this reason.
What helps is simplification at the source: export with fewer layers or less geometric detail, or render background layers as a single image while keeping labels as vectors. For a quick preview that does not need to be searchable, you can deliberately convert pages to images with PDF to JPG, compress those images, and rebuild a PDF with JPG to PDF – an explicit, lossy trade that the guide on PDF versus JPG for documents weighs up.
Encrypted files
An encrypted PDF cannot be analysed, let alone compressed, until it is decrypted: its content streams and images are ciphertext. A password-protected file therefore has to be opened with its password first. The compressor asks for it when it meets one, or you can produce an unprotected copy with Unlock PDF beforehand. There is no cracking involved: without the correct password the file stays closed, which is what encryption is for.
Once compressed, the output is unprotected. Re-apply protection with Protect PDF, which uses the PDF standard security handler with AES-256 by default (AES-128 optionally, for older readers). Encryption itself does not make a file noticeably larger – streams are compressed before they are encrypted – so compressing an encrypted file gives the same saving as compressing its unlocked twin. PDF passwords and encryption explained covers which password controls what.
Files that grow after a re-save
Occasionally a compressed PDF comes out slightly larger than the original. This happens when the input was already written as compactly as it could be – object streams present, no superseded objects, no thumbnails, efficient images – so the rewrite has nothing to remove and merely rearranges the same objects with a little different overhead. Re-encoded images are never the cause, because an image is only replaced when the new version is clearly smaller; the growth is structural and small.
Two other changes can matter. A re-saved file loses linearisation, the "fast web view" arrangement that lets a browser show the first page before the whole file has downloaded. And a digitally signed file is no longer signed after any rewrite, since the signature covers the original bytes. Neither is a reason to keep a bloated file, but both are reasons to keep the original alongside a compressed copy. Whenever the result is not smaller, the tool says so and offers you the original.
What to try instead
- Read the report. If nearly every image was skipped, the file is not image-bound and a stronger profile will not help.
- Check what the file is made of. Size per page, selectable text or not, and the producing application narrow the cause quickly; scanned versus searchable PDFs explains how to tell.
- Regenerate at the source when fonts or vectors are the problem: subset fonts, simplify drawings, export for screen rather than print.
- Re-scan sensibly when a scan is the problem: 200–300 dots per inch, greyscale or black-and-white unless colour carries meaning.
- Split instead of squeezing. If the destination has a per-file limit, splitting the document into two readable parts beats compressing one into illegibility.
- Share a link rather than an attachment when the file is legitimately large – an archive of high-resolution drawings will not fit in an email.
- Rasterise deliberately, as a last resort, for previews only, knowing that text search and crisp zooming are lost.
Try it: PDF Page Counter shows page sizes and counts, and Split PDF divides a file that is still too large.
The one thing not to do is run the file through compressor after compressor. Each lossy pass takes a little more out of the images without touching the fonts or structure actually responsible, leaving a document that is both large and ugly.
Frequently asked questions
Why is my compressed PDF the same size as the original?
Because nothing in it could be safely made smaller. Either its images were already efficiently compressed or stored in formats such as JPEG 2000, JBIG2 or CCITT that a browser cannot re-encode, or its size comes from embedded fonts and vector drawings that compression does not touch. The tool reports this instead of pretending to have saved space, and offers you the original.
Can I compress a password-protected PDF?
Only after it has been opened with its password – the contents are encrypted and cannot be analysed otherwise. Enter the password when prompted or unlock the file first, compress it, and then protect the result again. There is no way to compress or open an encrypted file without its password.
Why does a black-and-white scan not get any smaller?
Black-and-white scans are usually stored with JBIG2 or CCITT Group 4 encoding, which is designed for exactly that content and already extremely compact. Re-encoding those pages as JPEG would produce fuzzy grey text in a larger file, so they are left untouched. If the file is still too large, the scan resolution is the thing to change.
Sources and further reading
About the author
HelpMeJPG editorial teamEditorial team
The people who build and maintain the HelpMeJPG tools. Guides are written from the tools' own behaviour and the standards they implement, and are revised whenever a tool changes.