How to use it
- Drop the PDF onto the box and wait for the page count.
- Keep “Recompress images” for normal documents. Switch to “Flatten pages to images” only when you do not need selectable text.
- Pick a strength – Balanced is right for e-mail attachments; Strong for upload limits; High quality for print.
- Press “Compress PDF”, compare the sizes and download. If there is no gain, the tool explains why and what to try instead.
Example
A 24-page scanned contract of 18.4 MB contains 24 JPEG scans at 2480 × 3508 px. “Recompress images” on Balanced downscales each scan to 1800 px on the long edge and re-encodes it at 70%: the result is about 3.1 MB (83% smaller)and still searchable if the scan had an OCR text layer. A 6-page Word export of 140 KB with no pictures stays at 140 KB in image mode – and would grow to roughly 900 KB if flattened.
How the two methods work
Recompress images
The PDF is parsed with pdf-liband every image XObject is inspected. JPEG images (DCTDecode) and 8-bit Flate-compressed RGB or grey images without a soft mask, mask, custom decode array or CMYK/indexed colour are decoded by the browser, downscaled so that their longest edge is at most the preset’s limit, and re-encoded as baseline JPEG at the preset quality. The new stream replaces the old one only if it is at least 5% smaller, so a well-compressed file never gets worse. Everything else in the file – text, fonts, vector drawings, links, annotations, form fields – is written back unchanged, and the document is saved with object streams, which also tightens files produced by older generators.
Flatten pages to images
Each page is rendered with pdf.jsat the preset’s dpi (scale = dpi / 72), encoded as JPEG and placed on a new page of the original size. This removes every object that was not pixels: text layers, fonts, bookmarks, links and interactive fields. It is the only option that can shrink PDFs made of heavy vector artwork or thousands of small images, at the cost of searchability and crisp text.
Limits
- Encrypted PDFs cannot be rewritten – remove the protection with the PDF Unlock tool first.
- Images with transparency (soft masks), stencil masks, CMYK, 16-bit or indexed colour and JPEG 2000 are left untouched in image mode.
- Rendering is limited to 16 megapixels per page, so very large drawings are rendered at a lower dpi than chosen.
- Both methods run in memory; files of several hundred MB may fail on phones.
Sources: PDF 32000-1:2008 – Image XObjects, DCTDecode filter, pdf-lib – low-level API (PDFRawStream, PDFContext), pdf.js rendering API.
Questions
- Why did my PDF not get smaller?
- Because it contains no large images: text, vector graphics and fonts are already compressed losslessly and cannot be reduced without changing them. Flattening such a file produces a bigger PDF, which is why the tool only offers the download when the result is smaller.
- Will the text still be searchable after compression?
- Yes with "Recompress images" – only the pictures are rewritten. No with "Flatten pages to images": the pages become photos of themselves.
- Which strength should I use for an e-mail attachment?
- Balanced keeps scans readable at normal zoom and typically lands under 5 MB for a 20–30 page scan. Use Strong if the mail server limit is tight; pictures will look soft when zoomed in.
- Can I compress a password-protected PDF?
- Not directly. Run it through the PDF Unlock tool (you need the password if there is an open password), then compress the unlocked copy.