Original ToolkitPoint research

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:

Document profilePresetOriginalCompressedReductionText layer
Multi-page technical text document (3 pages, no rasters)Lossless (Object Streams & Metadata Cleanup)5.2 KB3.3 KB-37%Verified selectable
Multi-page technical text document (3 pages, no rasters)Web & Ebook (JPEG 70% Q, max 1600 px)5.2 KB3.3 KB-37%Verified selectable
Multi-page technical text document (3 pages, no rasters)Screen & Email (JPEG 50% Q, max 1000 px)5.2 KB3.3 KB-37%Verified selectable
Multi-page technical text document (3 pages, no rasters)Grayscale (JPEG Gray 70% Q, max 1600 px)5.2 KB3.3 KB-37%Verified selectable
High-resolution archival document scan (1 page, simulated JPEG scan)Lossless (Object Streams & Metadata Cleanup)115.1 KB114.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 KB61.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 KB38.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 KB59.5 KB-48.3%Verified selectable
Technical report with data table, text, and architecture diagram (2 pages)Lossless (Object Streams & Metadata Cleanup)21.9 KB20.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 KB15.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 KB13.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 KB13.3 KB-39.2%Verified selectable
Interactive inspection form with AcroForm fields & checkbox (1 page)Lossless (Object Streams & Metadata Cleanup)8.3 KB5.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 KB5.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 KB5.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 KB5.3 KB-36.4%Verified selectable
Widescreen presentation with shapes, text cards, and slide photo (3 slides)Lossless (Object Streams & Metadata Cleanup)96.7 KB95.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 KB54 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 KB31.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 KB46.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.

PDF Compression Benchmark results summary chart
Overview of baseline vs. compressed sizes across the five synthetic document profiles.

Reproducible methodology

  1. 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.
  2. Four compression transforms: Each document is processed through ToolkitPoint’s real client compression engine under Lossless Structural, Web & Ebook, Screen & Email, and Grayscale modes.
  3. 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.
  4. 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.
  5. 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

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.

Compress a PDF Flatten form fields Compare two PDFs