Skip to content

Hyper CompressSmaller PDFs that still work

A PDF compression engine that keeps text searchable, signatures valid and PDF/A honest, and never returns a bigger file. Runs in the browser, the terminal, Node.js, Rust, C and Docker.

Hyper Compress

What Hyper does ​

Hyper Compress goes through every part of a PDF and stores it in less space: images, fonts, page content and duplicate data. For each image it tries several encodings and keeps the smallest one that still looks right. Every risky change is checked, and anything that would change how a page looks is rolled back.

On top of the engine, Hyper adds the parts that make it safe to run on files you did not make: it decrypts with your password, repacks the file, can search for a target size, keeps PDF/A files honest, never returns a bigger file, and tells you about anything it skipped.

Start here ​

You want toGo to
Compress your first PDF in five minutesQuickstart
Pick settings for your documentsChoose the right settings
Get every file under an upload limitHit a file size target
Shrink scanned documentsScanned documents
Run a compression service for your teamSelf-hosting and the HTTP API
Look up a function, flag, header or optionCLI, Node.js SDK, HTTP API, Options

How a compression runs ​

  1. Read. Hyper opens the PDF. If it is encrypted, it decrypts it with the password you gave.
  2. Compress. The engine runs in its own process, so a broken or hostile file cannot crash your program. It re-encodes images, subsets and merges fonts, rewrites page content compactly and removes what you asked it to remove.
  3. Repack. Objects are packed into compressed streams.
  4. Search (only with a size target). Hyper tries lower quality and then lower resolution until the file fits, or returns the smallest file it can make.
  5. Check. If the result is not smaller than the input, you get the input back. PDF/A claims are kept only when they are still true.
  6. Report. You get the sizes, whether the file was signed, its PDF/A level, whether a target was met, and a warning for anything that was skipped.

Key ideas ​

  • Presets are complete sets of options: low, medium (the default), high and lossless. Start from one and change what you need. See Options.
  • Outcomes are not errors. "No gain", "signed, returned untouched" and "target not met" are normal results with clear flags. Errors are only for things like a wrong password or a timeout. See Errors.
  • Warnings explain every skip. When an option is unsafe for a file, Hyper skips it and tells you why. See Warnings.

Dual-licensed under AGPL-3.0 and Commercial License.