Skip to content

Platforms and surfaces ​

Hyper Compress ships one engine through seven surfaces: the browser page, the CLI, the Node.js SDK, the WebAssembly SDK, the HTTP service, the Rust crate and the C library. This page shows where each one runs and what each one can do, so you can pick one before you start.

Where each surface runs ​

SurfaceGet itRuns on
Browserhyper.bentopdf.comany modern browser; files never leave the device
CLInpm install -g hyper-compressmacOS Apple silicon, Linux x64, Linux ARM64, Windows x64, with Node.js 22 or newer
Node.js SDKnpm install hyper-compressmacOS Apple silicon, Linux x64, Linux ARM64, Windows x64, with Node.js 22 or newer
WebAssembly SDKnpm install hyper-compress-wasmany platform with Node.js 22 or newer, including Intel Macs, Alpine and FreeBSD, and browsers
HTTP API and web pageghcr.io/alam00000/bentopdf-hyper-compressDocker on linux/amd64 and linux/arm64
Rust craterust/hyper-compress in the repositorymacOS Apple silicon, Linux x64, Linux ARM64, Windows x64, next to the engine programs
C librarylibhypercompress on each releaseprebuilt for macOS Apple silicon; build it for other platforms

The Docker image runs the HTTP service and the CLI as Rust programs on Debian. It contains no Node.js.

Native packages ​

The hyper-compress npm package gets its engine from one platform package. npm installs only the one that matches your machine, and there are no install scripts.

Platformnpm package
macOS, Apple siliconhyper-compress-darwin-arm64
Linux, x64hyper-compress-linux-x64
Linux, ARM64hyper-compress-linux-arm64
Windows, x64hyper-compress-win32-x64

Each one holds the engine (hpdf-worker), qpdf, the Node.js addon (hyper-compress.node) and a page renderer (hpdf-render). Each Linux package is built on a machine with that CPU.

The Linux packages need glibc and are marked "libc": ["glibc"]. They run on Debian, Ubuntu, Fedora, Amazon Linux and similar distributions. On Alpine and other musl-based systems npm skips them, and the SDK then reports that there is no native engine for the platform. Use the WebAssembly SDK there, and on Intel Macs, which have no native package.

Release files ​

Each GitHub release attaches these files and a SHA256SUMS file to check them:

FileContents
hyper-compress-<version>-macos-arm64.tar.gzhpdf-worker, hpdf-render, qpdf and hyper-compress.node for macOS Apple silicon
hyper-compress-<version>-linux-x64.tar.gzthe same four files for Linux x64
hyper-compress-<version>-linux-arm64.tar.gzthe same four files for Linux ARM64
hyper-compress-<version>-windows-x64.tar.gzthe same four files for Windows x64, with qpdf's DLLs and the Microsoft C++ runtime DLLs
hyper-compress-<version>-wasm.tar.gzthe WebAssembly engine, hyper-compress.js and hyper-compress.wasm
libhypercompress-<version>-macos-arm64.tar.gzthe C library, libhypercompress.dylib, for macOS Apple silicon

<version> is the release tag, for example v1.1.4. On Linux, check the files you downloaded with:

bash
sha256sum -c SHA256SUMS --ignore-missing

The release also publishes the Docker image for linux/amd64 and linux/arm64 under one tag, plus latest. See Self-hosting.

What each surface can do ​

All surfaces share the same presets, the same options, the same size target search and the same output for the same settings. They differ in what wraps the engine:

FeatureCLINode.js SDKWebAssembly SDKHTTP APIRust crateC library
Presets and every optionyesyesyesyesyesas raw id and value pairs
Output never larger than the inputyesyesyesyesyesno, compare sizes yourself
Size target--target-sizetargetSizeBytestargetSizeBytestargetSizeBytestarget_size_bytesno
Encrypted input--passwordpasswordpasswordX-Passwordpasswordpassword
Password check without compressingnoverifyPasswordverifyPassword/api/verify-passwordverify_passwordno
Signed documents returned untouchedyesyesyesyesyesyes
removeSignaturesyesyesyesyesyesyes, id 20 bit 0x400000
preserveConformance for PDF/Ayesyesyesyesyesyes, as id 64
linearize (fast web view)yesyesno, reported as a warningyesyesno
Compression report--reportreportnonoreportno
Warnings for skipped optionsstderrwarningswarningsX-Warnings headerwarningsno
CancellationCtrl+CAbortSignalnoa client disconnect does not cancelCancelTokenno
Timeouts10 minutes per steptimeoutMs, totalTimeoutMsnoHYPER_TIMEOUT_MSstage_timeout, total_timeoutno
Crash isolationeach file in a worker processeach file in a worker processnone in process; use a worker threadeach file in a worker processeach file in a worker processnone, runs in your process

Threads and memory ​

Inside one compression, the native engine uses as many threads as the machine has cores, up to 8, for image work. The C library can set this with option id 68. The WebAssembly build uses one thread.

Every surface is safe to call from many threads at once. The CLI, Node.js SDK, Rust crate and HTTP service run each compression in its own engine process; the C API lets calls take turns; a WebAssembly instance runs one compression at a time. See Safe to call from many threads at once.

The native engine reads and writes files on disk, so its memory use depends on the document's content, mostly its largest images, more than on the file size. The C library's hpdf_compress_buffer refuses inputs over 2 GB.

The WebAssembly build holds the input, its working memory and the output in a memory space of at most 4 GB. For files in the hundreds of megabytes, use a native surface.

Next steps ​

  • Quickstart: compress your first PDF on any surface.
  • Self-hosting: run the HTTP service with Docker or Kubernetes.
  • Building from source: build the engine for a platform without a prebuilt package.
  • FAQ: common platform and install problems.

Dual-licensed under AGPL-3.0 and Commercial License.