Client-Side PDF Compressor
Shrink a heavy PDF by re-rasterizing each page at adjustable JPEG quality. Very effective for image-heavy or scanned documents. Runs entirely in your browser.
Read this first. Browser PDF libraries (pdf-lib, jsPDF) don't expose
image re-compression — so the only honest way to shrink a PDF in the browser is to
rasterize each page (render it through pdf.js to a canvas, save as JPEG,
embed back into a fresh PDF). The result loses selectable text and turns
fonts into pixels. It's perfect for scanned documents, image-heavy reports, and
photo-album PDFs. It is not what you want for a PDF you need to keep
searchable. Use the source document and re-export at lower quality instead.
Drop a PDF to compress
.pdf only · renders locally
Pipeline
- Load PDF into pdf.js.
- For each page: render to canvas at the chosen scale (default 1×, which is roughly screen-DPI). Lower scale = smaller output, fewer pixels per page.
- Convert canvas to JPEG at the chosen quality (
canvas.toBlob('image/jpeg', q/100)). - Create a fresh PDF with pdf-lib. For each page, embed the JPEG so the page dimensions match the original viewport.
- Serialize → download.
Both libraries are lazy-loaded from cdnjs on first run.