Why your PDF is so big

A 2-page invoice. 14 megabytes. Here's what's actually inside a bloated PDF — and how to fix it without sending it anywhere.

The email bounced. “Message size exceeds maximum permitted.” James had tried to attach a two-page invoice — a plain document, logo at the top, a table of line items, a total — and the file was 14 megabytes. He opened it in Preview. Two pages. Looked completely normal. He sent it again as a Google Drive link, felt faintly ridiculous, and filed the incident away as one of those things computers do that don’t make sense.

He wasn’t wrong to be confused. A two-page document with no photographs should not be 14 megabytes. A novel is 14 megabytes. A 14-megabyte invoice suggests something has gone wrong, but the document looks fine, so what?

PDFs are containers. This is the thing most people don’t understand, because PDFs look like documents — like flat representations of pages — but they’re actually more like ZIP files with a rendering layer on top. Inside a PDF you can have multiple versions of the same image at different resolutions. You can have embedded fonts — not references to fonts, the actual font files, sometimes several megabytes each. You can have colour profiles: ICC profiles that describe how colours should be rendered on specific types of screens or printers, often embedded by design software whether you wanted them or not. You can have object streams, cross-reference tables, digital certificates, JavaScript, form data, hidden annotations, metadata trees, version histories from incremental updates. A PDF that has been edited three times doesn’t just contain the final version — it contains three layers of edits, all stacked on top of each other, because that’s how the format works by default.

James’s invoice was 14 megabytes because the design software he used — a common one, used by millions of people — embedded the full font files for every typeface in the document, included a high-resolution version of the company logo at 600 DPI suitable for commercial printing, and attached an ICC colour profile intended for offset lithography. None of this is visible when you open the file. All of it makes the file enormous.

This is not a bug. It’s what the software was designed to do. Design software is built by people who work in print, and print has different requirements from email. 600 DPI is correct for a brochure. It’s comically wasteful for an invoice that will be read on a screen at 96 DPI. The ICC profile is appropriate for a magazine. It’s invisible overhead for a PDF that will never touch a printing press.

The fix, when you understand the structure, is conceptually simple. Strip the colour profiles. Downsample the images to screen resolution — 150 DPI, maybe 120 DPI for something that will only ever be read on screen. Compress the images using JPEG at an appropriate quality level. Remove the incremental update layers and write a clean, linearised file. Subset the embedded fonts so only the characters actually used in the document are included, not the full typeface.

This is what Ghostscript does. Ghostscript is a PostScript and PDF interpreter that has been in continuous development since 1988, which makes it older than the World Wide Web. It is extraordinarily good at understanding the internals of PDF files and rewriting them efficiently. The ebook preset — one of Ghostscript’s compression profiles — will downsample images to 150 DPI and apply all the optimisations above. For a document like James’s invoice, it will typically reduce a 14-megabyte file to under two megabytes, invisibly. The document looks identical on screen. The content is unchanged. Eighty percent of the weight is just gone.

The remarkable thing is that Ghostscript, compiled to WebAssembly, runs in a browser tab. The compression — the same algorithm that professional print shops and PDF software vendors use — can happen entirely on your machine, in the browser you already have open. No server required. No upload. No waiting for a remote processing queue. Just your CPU, Ghostscript, and a file that is suddenly small enough to email.

fwip compresses PDFs in your browser using Ghostscript — up to 86% smaller, no upload required. Try it →

Try compress pdf →