PDF compression benchmark: in-browser file size and font fidelity
We generated five deterministic synthetic PDF documents spanning text-heavy drafts, scanned archival records, hybrid reports with diagrams, interactive AcroForms, and widescreen presentation slides. We then evaluated each document across four client-side compression presets in Google Chrome using ToolkitPoint’s client PDF engine. The full 20-row result set is downloadable in CSV and JSON formats, and the execution script is fully reproducible.
What the empirical results show
Document structure dictates which optimization technique yields meaningful file-size reductions:
- Scanned documents benefit most from raster resampling: For archival invoices and scanned paperwork dominated by full-page images, the Screen & Email preset (JPEG 50% quality, max 1000 px) reduced file size by 66.9% (from 115.1 KB to 38.1 KB), while Web & Ebook achieved a 46.5% drop (down to 61.6 KB). Lossless structural optimization alone yielded only a 0.5% decrease because the underlying raster stream was already compressed.
- Text documents and interactive forms shrink significantly under lossless object streams: In multi-page text documents and AcroForms with no embedded rasters, lossless structural optimization achieved 37% savings on text (down from 5.2 KB to 3.3 KB) and 36.4% on forms (from 8.3 KB to 5.3 KB). This was achieved entirely by packing uncompressed cross-reference and indirect object tables into PDF 1.5 object streams and removing orphaned metadata. Because no JPEG streams existed to re-encode, the image presets produced the exact same compact output.
- Mixed reports and slide decks balance vector clarity with raster compression: Hybrid documents containing paragraphs, vector data tables, and an embedded technical diagram saved 6.5% losslessly and up to 39% under raster resampling. Presentations achieved up to a 67% reduction while preserving sharp slide typography and geometric shapes.
- Verified 100% text selectability: Across all 20 benchmark configurations, post-compression text extraction via Mozilla PDF.js confirmed that zero characters were rasterized, dropped, or corrupted. Document text remained fully selectable, copy-pasteable, and searchable.
| Document profile | Preset | Original | Compressed | Reduction | Text layer |
|---|---|---|---|---|---|
| Multi-page technical text document (3 pages, no rasters) | Lossless (Object Streams & Metadata Cleanup) | 5.2 KB | 3.3 KB | -37% | Verified selectable |
| Multi-page technical text document (3 pages, no rasters) | Web & Ebook (JPEG 70% Q, max 1600 px) | 5.2 KB | 3.3 KB | -37% | Verified selectable |
| Multi-page technical text document (3 pages, no rasters) | Screen & Email (JPEG 50% Q, max 1000 px) | 5.2 KB | 3.3 KB | -37% | Verified selectable |
| Multi-page technical text document (3 pages, no rasters) | Grayscale (JPEG Gray 70% Q, max 1600 px) | 5.2 KB | 3.3 KB | -37% | Verified selectable |
| High-resolution archival document scan (1 page, simulated JPEG scan) | Lossless (Object Streams & Metadata Cleanup) | 115.1 KB | 114.5 KB | -0.5% | Verified selectable |
| High-resolution archival document scan (1 page, simulated JPEG scan) | Web & Ebook (JPEG 70% Q, max 1600 px) | 115.1 KB | 61.6 KB | -46.5% | Verified selectable |
| High-resolution archival document scan (1 page, simulated JPEG scan) | Screen & Email (JPEG 50% Q, max 1000 px) | 115.1 KB | 38.1 KB | -66.9% | Verified selectable |
| High-resolution archival document scan (1 page, simulated JPEG scan) | Grayscale (JPEG Gray 70% Q, max 1600 px) | 115.1 KB | 59.5 KB | -48.3% | Verified selectable |
| Technical report with data table, text, and architecture diagram (2 pages) | Lossless (Object Streams & Metadata Cleanup) | 21.9 KB | 20.5 KB | -6.5% | Verified selectable |
| Technical report with data table, text, and architecture diagram (2 pages) | Web & Ebook (JPEG 70% Q, max 1600 px) | 21.9 KB | 15.4 KB | -29.8% | Verified selectable |
| Technical report with data table, text, and architecture diagram (2 pages) | Screen & Email (JPEG 50% Q, max 1000 px) | 21.9 KB | 13.4 KB | -39% | Verified selectable |
| Technical report with data table, text, and architecture diagram (2 pages) | Grayscale (JPEG Gray 70% Q, max 1600 px) | 21.9 KB | 13.3 KB | -39.2% | Verified selectable |
| Interactive inspection form with AcroForm fields & checkbox (1 page) | Lossless (Object Streams & Metadata Cleanup) | 8.3 KB | 5.3 KB | -36.4% | Verified selectable |
| Interactive inspection form with AcroForm fields & checkbox (1 page) | Web & Ebook (JPEG 70% Q, max 1600 px) | 8.3 KB | 5.3 KB | -36.4% | Verified selectable |
| Interactive inspection form with AcroForm fields & checkbox (1 page) | Screen & Email (JPEG 50% Q, max 1000 px) | 8.3 KB | 5.3 KB | -36.4% | Verified selectable |
| Interactive inspection form with AcroForm fields & checkbox (1 page) | Grayscale (JPEG Gray 70% Q, max 1600 px) | 8.3 KB | 5.3 KB | -36.4% | Verified selectable |
| Widescreen presentation with shapes, text cards, and slide photo (3 slides) | Lossless (Object Streams & Metadata Cleanup) | 96.7 KB | 95.2 KB | -1.6% | Verified selectable |
| Widescreen presentation with shapes, text cards, and slide photo (3 slides) | Web & Ebook (JPEG 70% Q, max 1600 px) | 96.7 KB | 54 KB | -44.1% | Verified selectable |
| Widescreen presentation with shapes, text cards, and slide photo (3 slides) | Screen & Email (JPEG 50% Q, max 1000 px) | 96.7 KB | 31.9 KB | -67% | Verified selectable |
| Widescreen presentation with shapes, text cards, and slide photo (3 slides) | Grayscale (JPEG Gray 70% Q, max 1600 px) | 96.7 KB | 46.7 KB | -51.7% | Verified selectable |
All 20 measurements were captured in local browser memory. No files were transmitted over a network. Measurements reflect client execution on clean, reproducible synthetic inputs unencumbered by proprietary licensing.

Reproducible methodology
- Deterministic document generation: A committed script constructs five uncompressed synthetic PDFs using
pdf-lib: a 3-page text document with body paragraphs and vector dividers, a simulated document scan with noise texture and OCR text overlay, a 2-page hybrid report with tables and an architecture diagram, an interactive AcroForm with text inputs and checkboxes, and a 3-slide 16:9 presentation deck. Fixed metadata timestamps ensure byte-level determinism. - Four compression transforms: Each document is processed through ToolkitPoint’s real client compression engine under Lossless Structural, Web & Ebook, Screen & Email, and Grayscale modes.
- Image re-encoding: Embedded JPEG streams are extracted, decoded with
createImageBitmap, resampled on a canvas to preset dimensions and compression qualities, and repacked into PDF XObject dictionaries. Non-JPEG streams and streams that would not achieve at least 5% savings are preserved untouched. - Object stream consolidation: Documents are re-serialized with PDF 1.5 object streams (
useObjectStreams: true), consolidating indirect objects into Flate-compressed containers and cleaning XMP metadata and unused thumbnail dictionaries. - Automated fidelity audit: Output byte streams are parsed with Mozilla PDF.js (
pdfjs-dist) to verify that extracted text strings match the original content exactly.
Download the exact reproduction script and run npm run benchmark:pdf in a locally installed Chromium or Edge browser to verify all measurements on your own machine.
Choosing the appropriate compression preset
- Choose Lossless Structural Optimization for formal legal contracts, court filings, tax documents, and pre-press vector artwork where raster re-encoding is impermissible but smaller file sizes and clean metadata are required.
- Choose Web & Ebook (1600 px, 70% quality) for corporate annual reports, research whitepapers, and presentation decks destined for web publishing or tablet viewing, retaining high visual sharpness while cutting file weights in half.
- Choose Screen & Email (1000 px, 50% quality) when strictly meeting email attachment caps (e.g. under 10 MB or 25 MB) or optimizing for low-bandwidth mobile reading.
- Choose Grayscale Document for invoices, utility bills, and administrative paperwork where full color adds unnecessary storage overhead.
Limitations
Synthetic documents are reproducible and unencumbered by copyright, but real-world PDFs vary widely in font subset embedding, JBIG2/JPEG2000 compression, pre-existing object stream density, and vector path complexity. Files with already-optimized JPEG streams will show lower incremental savings. Real-world PDFs authored by different software tools may feature unembedded font subsets, CCITT Fax or JBIG2 monochrome encoding, linearisation structures, or pre-existing high-density object streams that limit incremental savings. ToolkitPoint never destructive-rasterizes pages; documents composed exclusively of non-JPEG streams or already-optimal object streams will exhibit modest or zero size reduction.