What the PDF Compressor does
The PDF Compressor takes one PDF and produces a new one named after the original with -compressed added before the extension, so report.pdf becomes report-compressed.pdf. After the run it shows the size before and after and how much smaller the result is as a percentage. If the new file is not smaller, it says the original was already optimized rather than pretending otherwise.
Three levels are offered and they do quite different things. Lossless loads the PDF with pdf-lib and saves it again with object streams enabled, which packs the file's internal objects more tightly without touching page content. Balanced and Strong use pdf.js to draw every page onto a canvas, export that canvas as a JPEG, and place the JPEG on a fresh page of the same size in a new PDF.
That difference matters more than the level names suggest. Choose Lossless for contracts, forms, invoices and anything you may need to search, copy from or fill in later. Choose Balanced or Strong for scanned or photo-heavy documents where the pages are already pictures and a smaller email attachment is the goal.
How to use it
Choose a PDF
Click the drop area and select one PDF from your device. The picker suggests files up to 100 MB; the real ceiling is your browser's memory.
Pick a level
Lossless is selected by default. Switch to Balanced or Strong only if you accept that the pages become images and the text stops being selectable.
Compress and download
Press Compress and watch the progress figure. The result card then shows the new file with its size before and after; press Download on the card to save it, and compare the two sizes before you replace anything.
What each compression level does to the file
Lossless: pdf-lib parses the document and writes it back out with useObjectStreams enabled and the metadata left as it was. Fonts, vector graphics, images, links, bookmarks and form fields are all kept, because the page content itself is never decoded. Savings come from tighter packing of the file structure, so a PDF that was already saved with object streams may shrink very little or not at all.
Balanced: pdf.js renders each page at a scale of 2, meaning twice the page's point size. A PDF point is 1/72 inch, so this is about 144 pixels per inch. The canvas is filled white, the page is drawn onto it, and it is exported as a JPEG at quality 0.9. That JPEG is then placed on a page with the original page's width and height.
Strong: the same pipeline at a scale of 1.55, about 112 pixels per inch, and JPEG quality 0.8. Text at normal body sizes usually stays readable on screen, but fine print, thin rules and small diagrams soften noticeably, and the file is smaller for it.
What you lose in Balanced and Strong mode
Every page becomes one JPEG. Text can no longer be selected, searched or read aloud by assistive software, links and form fields disappear, bookmarks are gone, and transparent areas are flattened onto a white background. Page count and page dimensions are preserved, and pages that carry a rotation setting are output in their displayed orientation.
Because JPEG is a lossy format, repeated compression stacks up. Keep the original and compress from it each time rather than compressing a compressed copy. If you need the text to remain searchable in a smaller file, Lossless is the only option here; recompressing embedded images while keeping the text layer is a different job and this tool does not do it.
Why a lossless result is sometimes larger
Object streams reduce overhead when a file has many small objects, which is typical of documents exported from office software. A scanned PDF, by contrast, is mostly one large image per page, and its structure is already minimal. Rewriting it can add a few bytes rather than remove any. The tool reports this plainly with the message that the original was already optimized, and you can simply keep your original file.
Limits to know before you rely on it
- Encrypted or password-protected PDFs cannot be opened; the tool reports that the PDF is protected and stops.
- Balanced and Strong remove selectable text, links, form fields, bookmarks and transparency from every page.
- Lossless mode cannot shrink a file that already uses object streams or consists mainly of large images.
- Very large or long documents can exhaust browser memory, because each page is rendered to a canvas in turn.
- Only one file is processed at a time; there is no batch mode.
Questions people ask about the PDF Compressor
Which setting keeps the text selectable and searchable?
Only Lossless. It rewrites the file structure and leaves fonts and text objects untouched, so copying, searching and screen readers keep working. Balanced and Strong replace each page with a JPEG picture of itself, and a picture has no text layer.
Why does the compressed file open as a single image per page?
That is what Balanced and Strong produce by design: pdf.js draws the page onto a canvas and the canvas is saved as one JPEG. If you want the original structure back, run the original file again with Lossless selected.
Does the tool change the page size or the number of pages?
No. Lossless does not touch pages at all. Balanced and Strong create a new page with the same width and height in points for every source page, and the page count stays identical.
Can I compress a PDF that has a password?
Not while the password is in place. pdf-lib refuses to load encrypted files and the tool shows a protected-file message. Remove the password first, with the document owner's permission, and then compress the open copy.
How much smaller will my PDF get?
There is no fixed figure. A text document from a word processor often shrinks little under Lossless because it is already compact, while a scan with large colour images can shrink a great deal under Strong. The result card shows the before and after sizes so you can judge each file on its own.
Is the PDF uploaded anywhere during compression?
No. The page loads pdf-lib and pdf.js into your browser and does all reading, rendering and saving there. The Download button on the result card saves the new file through a temporary object URL that exists only in your browser session.
Sources and further reading
- pdf-lib API reference for PDFDocument: load and save, including the useObjectStreams option used by Lossless mode
- pdf.js API reference for PDFPageProxy: getViewport and render, used to draw pages at scale 2 or 1.55
- MDN Web Docs: HTMLCanvasElement.toBlob and its JPEG quality argument between 0 and 1
- Library of Congress format description of the PDF (Portable Document Format) family