Z
Zynocode

All tools are provided for informational and educational purposes. Processed data is stored fully inside your browser memory and never uploaded to our servers.

Back to Tools

PDF Compressor

Last updated

Quick Answer

The client-side PDF compressor shrinks document file sizes entirely in your browser using pdfjs-dist and pdf-lib without server uploads. It offers two modes: 'Keep Text' to preserve vector fonts and selectable text, and 'Smallest File' to rasterize pages into compressed JPEGs. It includes automated grayscale fallbacks to satisfy strict government form ceilings such as 100KB or 200KB.

Compress PDF files to reduce file size while maintaining quality.

Runs in your browser

Your files and text are processed locally in your browser and are not uploaded.

Create Account

How Does Client-Side PDF Compression Shrink Multi-Page Documents?

The Zynocode Labs PDF Compressor is a high-performance, client-side document optimization suite engineered to shrink PDF file sizes directly inside your web browser. Online job applications, government recruitment exams, state public service commissions, university registration forms, and corporate HR portals frequently impose rigid file size ceilings—mandating that submitted documents not exceed 100 KB, 200 KB, 500 KB, or 1 MB. This tool provides two specialized compression architectures tailored to different operational requirements: Smallest File mode and Keep Text mode.

Smallest File Mode (Target Sizing & Rasterization): Built specifically to conquer strict portal upload limits, Smallest File mode renders each document page into an in-memory HTML5 canvas using Mozilla's pdfjs engine. The rasterized canvas is re-encoded as an optimized JPEG byte stream and embedded into a newly structured PDF container using pdf-lib at original page dimensions (e.g. standard A4 or US Letter). This approach achieves aggressive compression ratios—often shrinking 5 MB to 15 MB scanned certificate files down to under 200 KB or 100 KB.

The Text Selectability Trade-Off: Users must understand the technical compromise of Smallest File mode: because pages are converted into high-density raster graphics, embedded text is no longer selectable, highlightable, or copyable as raw ASCII strings. However, visual fidelity, typography, signatures, official rubber stamps, government emblems, and marksheet tables remain crisp and easily readable by human reviewers. For applications where selectable vector text, searchable words, and interactive hyperlinks are mandatory, switch to Keep Text mode instead.

Keep Text Mode (Object Stream Repacking): Designed for legal contracts, research papers, and administrative publications where text must remain searchable and selectable. In this mode, the engine uses pdf-lib to compress internal cross-reference tables and reorganize dictionary objects into Flate-encoded object streams. Because it does not re-encode embedded raster images, size savings in Keep Text mode are typically modest (ranging from 5% to 25%). Crucially, the engine guarantees that Keep Text mode will never return a file larger than the original; if repackaging yields zero reduction, the original document is returned with an honest advisory note.

Intelligent Resolution Stepping & Grayscale Fallback: When you specify an exact target size (such as Under 100 KB or Under 200 KB), the engine searches candidate resolution steps (150 DPI → 120 DPI → 100 DPI → 85 DPI → 72 DPI) and JPEG quality levels. It strictly prioritizes visual legibility by maintaining JPEG quality at or above 60% while stepping down resolution first. If color cannot hit the target ceiling, the engine automatically falls back to grayscale (150 down to 50 DPI). When resolution drops below 72 DPI (to 60 or 50 DPI), results are flagged with a low-resolution notice ('Low resolution — check readability before uploading') and the first-page preview is displayed prominently so you can inspect text legibility before submitting. Furthermore, after probing page 1 at the lowest setting, if total pages multiplied by that minimum size clearly exceeds your target limit, the engine stops immediately without running the full ladder on all pages, reports the minimum achievable size, and suggests splitting the document with /tools/pdf-splitter or choosing a larger ceiling.

Never Return a Bigger File & Already-Small Preservation: If your uploaded PDF is already at or below the target ceiling (such as a 50 KB file with a 100 KB target), the engine returns the original unchanged with the note 'Your PDF is already under X KB — no compression needed.' Similarly, if compressing a well-optimized file makes it larger, the original is retained with an honest advisory note.

Worked Example:
A candidate uploads a 3-page scanned color marksheet measuring 4,850 KB (4.74 MB). The recruitment portal enforces a strict 200 KB ceiling. Selecting Smallest File mode with the 200 KB preset, the engine selects 100 DPI and 65% JPEG quality. In 1.6 seconds, it compiles a compliant 174 KB PDF (a 96.4% reduction, saving 4,676 KB). The first-page preview card confirms stamp legibility, and the file is accepted without upload rejection.

A PDF Compressor reduces PDF file size for email sharing or portal upload ceilings. This tool provides two distinct modes: 'Smallest File' (rasterizes pages to compressed JPEGs to reach exact targets like 100 KB or 200 KB) and 'Keep Text' (repacks internal object streams while preserving selectable text). Everything runs 100% client-side in browser memory with zero server uploads.

Definition: PDF Compression (Rasterization vs Object Repacking)

The technique of reducing Portable Document Format (PDF) byte sizes either by rasterizing pages into compressed image streams (trading text selectability for aggressive size reductions) or by reorganizing uncompressed internal PDF dictionary objects and xref tables into Flate-encoded object streams.

What PDF Compression Modes and Ceilings Are Supported?

Required Inputs

  • PDF FileSelect or drop any PDF document from your computer or smartphone.
  • Compression ModeChoose 'Smallest File' (for strict KB limits) or 'Keep Text' (preserves selectable text).
  • Target Size CeilingSelect Under 100 KB, 200 KB, 500 KB, 1 MB, or specify a Custom KB limit.
  • Convert to GrayscaleOptional toggle to strip color channels and reduce byte weight for black & white documents.

Expected Outputs

  • Compressed PDF DocumentOptimized PDF file ready for download (<original-name>-compressed.pdf).
  • Technical MetricsDisplays original size, compressed size, percentage saved, page count, and DPI/quality used.
  • First Page PreviewVisual thumbnail preview of the first page of the optimized PDF.

Who Uses the PDF Compressor?

Government & Examination Portal Uploads

Compress scanned certificates, marksheets, and identity proofs to fit strict 100 KB, 200 KB, or 500 KB upload ceilings.

Email Attachment Limits

Reduce large scanned PDF contracts or pitch decks under standard 10 MB or 25 MB mailbox limits.

Mobile Data Optimization

Shrink heavy multi-page PDF brochures and guides for fast mobile downloading without long loading times.

Confidential Legal & Tax Archiving

Compress sensitive bank statements, tax returns, and signed agreements with guaranteed client-side privacy.

How Do You Compress a PDF to Exact KB Limits Step-by-Step?

  1. 1Upload your PDF file by dragging it into the dropzone or clicking Choose File.
  2. 2Select your Compression Mode: choose 'Smallest File' for maximum size reduction or 'Keep Text' to preserve selectable text.
  3. 3If using Smallest File, select an exact Target Size Ceiling (100 KB, 200 KB, 500 KB, 1 MB, or Custom) and optionally enable Grayscale.
  4. 4Click 'Compress PDF' to execute the compression algorithm locally inside your browser.
  5. 5Review the compression statistics, inspect the first-page thumbnail preview, and click 'Download Compressed PDF'.

PDF Engine Capabilities, Resolution Steps, and Privacy Facts

Compression ModesSmallest File (rasterized) & Keep Text (object streams)
Target Sizing PresetsUnder 100 KB, 200 KB, 500 KB, 1 MB, or Custom
Engine StackMozilla pdfjs-dist & pdf-lib (100% Browser)
Text SelectabilityPreserved in Keep Text mode; rasterized in Smallest File mode
Privacy GuaranteeZero cloud uploads — runs entirely in local browser RAM

Privacy & Security Guarantee

All PDF parsing, page rendering, and re-encoding executes 100% locally inside your web browser. Your private documents are never transmitted across the network.

Frequently Asked Questions

Why is text not selectable after using Smallest File mode?

In Smallest File mode, each page is rendered to an in-memory canvas and converted into a highly optimized JPEG image before being embedded in a new PDF. This allows the engine to achieve dramatic size reductions (like 100 KB or 200 KB) for scanned files, but text becomes part of the page image rather than selectable vector glyphs.

When should I use Keep Text mode instead?

Use Keep Text mode for digital text documents such as business contracts, legal agreements, and academic dissertations where users must be able to search, copy, or highlight words. Keep Text mode reorganizes internal data structures without rasterizing pages, but size savings are modest.

Can any PDF be compressed to under 100 KB?

How many pages can fit under 100 KB depends entirely on document density and page count. Single-page documents compress under 100 KB easily. For multi-page scans, the engine searches color tiers down to 72 DPI, then automatically tries grayscale down to 50 DPI. When resolution drops below 72 DPI, results are flagged with a low-resolution notice because text is legible only for large print. If even 50 DPI grayscale cannot fit within 100 KB, the engine stops early and advises splitting the document.

Does the compressor ever make my PDF larger?

No. If compressing in either mode produces a file larger than or equal to the original, or if your PDF is already under your target size ceiling, our engine returns the original file unchanged with an honest explanatory note.

Can I compress password-protected PDF files?

No. The local compression engine must parse and re-render document pages in memory. If your PDF has an open password, unlock or decrypt it first before compressing.

Are my sensitive documents uploaded to your servers?

No. All PDF parsing, canvas rendering, and JPEG encoding takes place 100% locally inside your web browser. No document pages or data are ever transmitted over the network.