Guide
About lossless vs lossy PDF compression
By Logappradeep · ServiceNow developer
Most oversized PDFs are big for one reason: images. A scanned page saved at high resolution, phone photos dropped into a report or a slide deck with full-size pictures can push a document past email limits even if it only has a few pages. Text and vector graphics, by comparison, take very little space. Understanding that difference helps you pick the right compression level.
The three levels
- Lossless: the document is re-saved with compact object streams and unused objects are dropped. Nothing visible changes. Savings are modest and depend on how efficiently the original was written; a file exported by a careful program may barely shrink.
- Strong: embedded images are decoded and re-encoded as JPEG at a lower quality and, where they are larger than needed, a lower resolution. Text, fonts and vector drawings are left alone, so text remains sharp and selectable. This is usually the best balance for scanned documents and image-heavy reports.
- Extreme: every page is rendered to an image and the PDF is rebuilt from those images. This gives the most predictable small size for complex files, but the text is no longer real text: you cannot select, search or copy it, and it may look slightly soft when zoomed in.
Why images dominate file size
An A4 page scanned at 300 DPI is about 2480 by 3508 pixels, nearly nine million pixels. Stored losslessly, that can be several megabytes per page. JPEG compression discards detail the eye barely notices, and lowering the resolution to around 150 DPI quarters the pixel count while staying readable on screen. A page of plain text, meanwhile, might take only a few kilobytes because it is stored as characters and font references.
Privacy and processing
Compression runs in your browser with pdf-lib, pdf.js and the Canvas API. Images are decoded and re-encoded on your own device, so contracts, IDs and financial statements are not uploaded to a compression service.
Choosing a level
- Start with Lossless for text-heavy documents; if the result is still too big, try the next level.
- Use Strong for scans and photo-heavy files that must stay searchable.
- Reserve Extreme for when you only need a readable copy under a strict size limit, such as a portal capped at 2 MB.
Pitfalls
Compression cannot do much for a PDF that is already optimized; sometimes the output is the same size or even marginally larger, in which case keep the original. Fine print in scans and detailed charts can blur at aggressive settings, so zoom in and check before sending. Extreme mode removes form fields, links and selectable text, and any digital signature is invalidated by any level of recompression. Always keep the original file.