🐱We're live on Product Hunt today!Support our launch→
Toolhast

Kompresja PDF

Zmniejszaj rozmiar plików PDF bez widocznej utraty czytelności. 100% lokalnie.

Choose a PDF file or drag & drop it here

Reduce PDF file size while maintaining optimal visual clarity and page layout

100% In-Browser Privacy — Files never leave your device

Jak używać: Kompresja PDF

  1. Drop your PDF document into the compression workspace or browse your local files to load your multi-page document.

  2. Select a compression preset: Extreme (max reduction), Recommended (balanced), or Light (print quality).

  3. Click 'Compress PDF' to initiate real-time canvas stream downsampling and structural object compaction.

  4. Review your exact megabyte savings and percentage reduction, then download your optimized PDF instantly.

Przykłady

Dane wejściowe
Scanned Mortgage Deed: 8-page document containing 300 DPI phone camera scans totaling 18.4 MB
Wynik
Compressed using 'Recommended' preset down to 3.2 MB (82.6% reduction) with pristine document legibility

Downsamples heavy raster XObjects while maintaining exact physical page dimensions and aspect ratios.

Dane wejściowe
Corporate Quarterly Presentation: 24-slide deck with embedded graphics totaling 12.5 MB blocking email send
Wynik
Compressed using 'Extreme' preset down to 2.1 MB (83.2% reduction) passing standard 5 MB email limits

100% private in-browser WebAssembly processing; confidential financial decks never touch an external server.

Comprehensive Technical Guide to PDF Stream Compression, Quantization & Architecture

In modern electronic document exchange, managing PDF file sizes is a ubiquitous operational challenge. Corporate mail transfer agents (MTAs) routinely block outbound emails containing attachments exceeding 10 MB or 25 MB, government procurement portals reject vendor proposals surpassing strict upload ceilings, and mobile users on restricted cellular bandwidth experience frustrating latency when loading unoptimized document files.

However, effectively reducing PDF file size requires understanding the internal object graph defined by the ISO 32000 specification. Toolhast provides an advanced, client-side document compressor that combines intelligent raster stream downsampling with object stream compaction to achieve up to 85% file size reductions while maintaining complete zero-upload in-browser privacy.

1. Inside PDF File Architecture: The Sources of Document Bloat

Contrary to common perception, textual character codes rarely contribute significantly to bloated PDF files. In a typical uncompressed 20 MB document, text streams account for less than 2% of the aggregate byte budget. The primary drivers of document bloat include:

  • Unoptimized Image XObjects (80% – 95% of bloat): Modern smartphones capture images at 12 to 48 megapixels (3000×4000 pixels or higher). When mobile scanner apps wrap these uncompressed raw bitmaps directly into PDF /Image dictionaries without downsampling, a single photographed receipt can consume 8 to 15 MB of storage.
  • Redundant Embedded Font Programs: Documents merged from multiple sources frequently embed duplicate full TrueType or OpenType font tables rather than generating compact, subsetted character glyph dictionaries.
  • Uncompressed Object Streams & Metadata Bloat: Older PDF generators store cross-reference tables (XREF) and metadata dictionaries as plain uncompressed ASCII streams rather than utilizing compressed Cross-Reference Streams introduced in PDF 1.5.
  • Orphaned Revision Histories: Incremental document saves in traditional desktop editors append revision deltas to the end of the file without purging superseded historical objects.

2. PDF Stream Compression Filters: DCTDecode vs. FlateDecode

In the ISO 32000 standard, byte streams are stored inside indirect objects associated with decompression filters (specified by the /Filter key):

12 0 obj
<<
  /Type /XObject
  /Subtype /Image
  /Width 2400
  /Height 3200
  /ColorSpace /DeviceRGB
  /BitsPerComponent 8
  /Filter /DCTDecode                % Discrete Cosine Transform (JPEG lossy)
  /Length 284510
>>
stream
... binary data ...
endstream
endobj

FlateDecode applies lossless Deflate (zlib/LZ77) compression, which is ideal for vector drawing commands, text character streams, and high-contrast technical line art. However, for photographic or continuous-tone scanned pages, FlateDecode cannot compete with DCTDecode (Discrete Cosine Transform), which achieves 10× to 20× higher compression ratios by eliminating imperceptible high-frequency visual noise.

3. Resolution Downsampling Mathematics & Bilinear Resampling

The fundamental lever in raster PDF compression is pixel downsampling. Physical page dimensions in PDF are fixed in PostScript points (1/72 inch). An 8.5 × 11 inch page contains 612 × 792 points. When a scanner embeds an image with 2550 × 3300 pixels onto that Letter page, the effective resolution is:

DPI = (PixelWidth / PointWidth) × 72 = (2550 / 612) × 72 = 300 DPI

While 300 DPI is standard for commercial offset printing, standard computer monitors and mobile retina displays display content between 96 and 160 DPI. By resampling a 300 DPI image down to 120 DPI (our Recommended tier) or 72 DPI (our Extreme tier), the total pixel count scales quadratically:

Pixel Ratio = (120 / 300)2 = 0.42 = 0.16 (84% reduction in raw pixel count!)

This mathematical reduction slashes the underlying memory footprint before JPEG discrete cosine transform encoding even begins, providing dramatic compression with minimal perceptible loss on digital screens.

4. Perceptual Quantization & Human Visual System (HVS) Tuning

Toolhast's three compression presets are calibrated against psycho-visual sensitivity curves established by the Human Visual System (HVS):

Preset TierTarget DPIJPEG QualityAverage Size SavingsIdeal Application
Extreme Compression72 DPI55% (Q55)65% – 85%Email attachments, slow web portals, mobile downloads
Recommended (Default)120 DPI75% (Q75)45% – 65%Office contracts, academic papers, client presentations
Light Compression180 DPI88% (Q88)25% – 45%High-resolution portfolios, commercial printing preparation

By combining custom quantization matrices with object stream compaction via pdf-lib's useObjectStreams: true, Toolhast consolidates individual page objects into shared, compressed binary streams, ensuring structural compactness alongside image optimization.

5. Zero-Upload Security & Institutional Privacy Compliance

Documents that require compression for email transmission — such as executed loan agreements, proprietary patent applications, patient intake records, and corporate tax schedules — often contain sensitive personally identifiable information (PII). Transmitting these files to remote server-based compression utilities introduces serious regulatory compliance liabilities under GDPR, HIPAA, and CCPA frameworks.

Toolhast executes all document parsing, canvas rendering, bilinear resampling, and JPEG encoding locally inside your web browser sandbox using WebAssembly and Web Worker threads. Your documents never leave your device memory, guaranteeing zero exposure, zero cloud storage, and 100% private execution.

Często zadawane pytania

How do I compress a PDF document using Toolhast?

Upload your PDF document into the workspace or click 'Try Sample PDF'. Select your preferred compression tier from Extreme, Recommended, or Light. Click 'Compress PDF' to downsample embedded images and compact object streams. In seconds, view your file size savings and download your lightweight PDF file.

Will compressing my PDF make the text unreadable or blurry?

No. Our 'Recommended' preset balances compression with visual clarity, keeping text sharp while shrinking heavy embedded photo streams. For print documents requiring maximum typographic sharpness, choose 'Light Compression'. Only 'Extreme Compression' applies aggressive downsampling, which is specifically designed for email attachments and strict web portal upload limits.

How much file size reduction can I expect from compression?

Reduction depends on document composition. PDFs containing high-resolution smartphone scans or uncompressed camera photos routinely compress by 60% to 85% without noticeable degradation. Documents consisting purely of vector text, spreadsheets, or already-compressed web graphics typically compress by 15% to 35% through object stream and structural compaction.

What is the difference between Extreme, Recommended, and Light compression?

Extreme Compression downsamples images to 72 DPI with 55% JPEG quality for maximum size reduction (~70% savings). Recommended Compression optimizes images to 120 DPI with 75% quality for everyday business sharing (~50% savings). Light Compression preserves 180 DPI resolution at 88% quality for professional printing (~30% savings).

Can I compress large multi-page scanned PDF documents?

Yes. Toolhast easily handles multi-page scanned contracts, presentation decks, and technical manuals. Our engine processes pages sequentially with real-time progress tracking. Because processing executes directly inside your browser memory, there are no arbitrary file size limits, queue delays, or server upload timeouts associated with cloud services.

Is it safe to compress confidential legal, financial, or medical PDFs here?

Yes, 100%. Toolhast executes all document decoding, canvas downsampling, and PDF serialization purely inside your local browser memory sandbox. Your sensitive tax forms, legal contracts, medical records, and business agreements are never uploaded, stored, or transmitted to external servers or third-party cloud data centers.

  • Podpisz PDF

    Podpisuj dokumenty PDF online: narysuj podpis, wpisz imię i nazwisko lub wstaw pieczęć.

  • Znak Wodny PDF

    Dodawaj tekstowe lub graficzne znaki wodne do stron PDF z regulacją przezroczystości.

Przeglądaj wszystkie narzędzia z kategorii Narzędzia PDF

Prywatnie: to narzędzie działa w Twojej przeglądarce. Żadne dane nie są przesyłane na serwer.

Ostatnia aktualizacja