How PDF compression works
Why a PDF is large in the first place, the two very different ways of shrinking one, and the trade Dexta's compressor makes that you need to know about.
In short
Almost all of a PDF's size is images, not text. Dexta's compressor renders each page to a JPEG and rebuilds the document from those pictures — very effective on scans, but your text stops being selectable. Keep the original.
A PDF is a container of objects: text with font references, vector drawings, and embedded images. Understanding which of those is making your file big is most of the work, because they behave completely differently.
Text is almost free. Images are everything.
Text in a PDF is stored as characters plus a reference to a font — not as a picture of words. A hundred pages of prose is a fraction of a megabyte. Vector drawings are mathematical descriptions and are similarly tiny.
Embedded images are stored as image data, and they are almost always the entire file size. This is why a 40MB PDF is usually ten scanned pages rather than a thousand written ones.
Two ways to shrink a PDF
The gentle method finds the images inside the document, re-encodes them at a lower resolution or quality, and puts them back. Everything else — text, fonts, vectors, links — is untouched. Desktop tools with a full PDF engine do this.
The blunt method renders each page to a picture and builds a new document out of those pictures. It works on anything, produces predictable savings, and destroys the structure: text becomes part of an image.
Which one Dexta uses, and why it matters
Dexta uses the second method. Each page is rendered with pdf.js at a reduced scale and encoded as JPEG, then the document is rebuilt from those images with pdf-lib.
| Level | Render scale | JPEG quality |
|---|---|---|
| Low | 1.5× | 80% |
| Medium | 1.1× | 60% |
| High | 0.8× | 45% |
The consequence is the important part. After compression, the text in your document is no longer text. It cannot be selected, copied, searched or read by a screen reader. Links stop working. Form fields are gone. What you get is a document that looks broadly the same and is considerably smaller.
When it is the right tool
- A scanned document that was already just pictures of pages — you lose nothing you had.
- A slide deck or brochure full of photographs, going to someone who only needs to look at it.
- Any document hitting a hard upload or attachment limit where the alternative is not sending it at all.
When to do something else instead
- A text document, contract or report. Compressing costs you the searchable text. Remove pages you do not need with Delete Pages, or send only the relevant ones with Extract Pages.
- Anything that has to remain accessible. A rasterised page is invisible to a screen reader.
- Anything someone will edit later. Send the original.
Mistakes worth avoiding
- Compressing your only copy. There is no way back to selectable text.
- Compressing a text-heavy report to save a couple of megabytes. The cost is out of proportion to the saving.
- Assuming a compressed PDF is smaller. On a document that was mostly text, rasterising can occasionally make it bigger — pictures of words cost more than words.