Options reference
Every field of HyperCompressOptions, in every surface that accepts options: the options object in the Node and WebAssembly SDKs, --set key=value in the CLI, and the options JSON parameter of the HTTP API. Pass any subset; unspecified fields come from the selected preset.
This page is generated from the SDK source, so it cannot drift from the code.
Images
| Option | Type | Default | What it does |
|---|---|---|---|
imageQuality | number 5 to 100 | 80 | JPEG quality for re-encoded images. Lower is smaller with more visible artefacts. Below about 20 the artefacts are obvious, which is why no preset goes there, but a size target can. |
maxDpi | number 0 to 600 | 150 | Images above this resolution are resampled down. 0 leaves resolution alone. |
forceDownsample | boolean | false | Resample even when the image is only slightly above the limit. |
lossless | boolean | false | Turns off quality, resolution and every other lossy image step. |
grayscale | boolean | false | Convert images to grayscale. |
reduceColor | boolean | false | Reduce colour complexity where it does not change appearance. |
clipImages | boolean | false | Crop image data hidden outside the visible clip region. |
preferJpx | boolean | false | Let JPEG 2000 compete with JPEG per image and keep the smaller one. |
removeAlternates | boolean | false | Drop alternate image versions. |
flattenIcc | boolean | false | Flatten ICC colour profiles. |
Rasterization
For image-only documents such as scans and print-to-PDF output. The engine refuses to rasterize when any page contains text, including an invisible OCR layer, so this cannot destroy searchable text; the skip is reported in the result's warnings. Rasterization is also disabled while preserving PDF/A conformance.
| Option | Type | Default | What it does |
|---|---|---|---|
rasterizePages | boolean | false | Replace each page with a single rendered image. Shrinks vector-heavy pages dramatically. |
rasterizeDpi | number 36 to 600 | 150 | Render resolution. Higher keeps more detail. |
rasterizeQuality | number 1 to 100 | 50 | JPEG quality for the rasterized pages. |
rasterizeText | boolean | false | Rasterize pages even when the document has a text layer. Text stops being selectable and searchable, and links stop working. Needs rasterizePages. |
Fonts
| Option | Type | Default | What it does |
|---|---|---|---|
subsetFonts | boolean | false | Keep only the glyphs the document uses. Lossless by definition. |
removeStandardFonts | boolean | false | Unembed the standard 14 PDF fonts; viewers supply them. |
unembedAliasedFonts | boolean | false | Unembed metric-compatible clones of the standard fonts. Arial, Times New Roman and Courier New map to the built-in equivalents. Only applied when safe. |
mergeFonts | boolean | false | Merge duplicate font programs and dictionaries. |
Structure and interactivity
| Option | Type | Default | What it does |
|---|---|---|---|
removeAnnots | boolean | false | Remove comments and other annotations. |
flattenForms | boolean | false | Flatten form fields into page content. Form fields stop being fillable. |
flattenLinks | boolean | false | Flatten link annotations. Links stop being clickable. |
removeSignatures | boolean | false | Remove digital signatures so a signed document can be compressed instead of returned untouched. The visible signature stays on the page, but the file is no longer signed and can be signed again. |
removeStructTree | boolean | false | Drop the structure tree. Removes tagging, which screen readers rely on. |
removeThreads | boolean | false | Remove article threads. |
Metadata and cleanup
| Option | Type | Default | What it does |
|---|---|---|---|
removeThumbnails | boolean | false | Remove embedded page thumbnails. |
removeAppData | boolean | false | Remove application-private data and piece info. |
removeSpiderInfo | boolean | false | Remove web capture information. |
removeOutputIntents | boolean | false | Remove output intents. |
Output format
| Option | Type | Default | What it does |
|---|---|---|---|
preserveConformance | boolean | false | Keep a PDF/A document conformant. Disables every step that would break the standard, including Brotli and rasterization; anything dropped is reported in warnings. |
brotli | boolean | false | PDF 2.0 Brotli stream compression. Smaller files, but the reader must support it (MuPDF 1.26+, Ghostscript 10.06+, Firefox). Off while preserving PDF/A. |
Preset values
What each preset sets, field by field. A preset is just a complete options object; start from one and override any field.
| Option | low | medium | high | lossless |
|---|---|---|---|---|
imageQuality | 80 | 50 | 20 | 100 |
maxDpi | 200 | 150 | 72 | 0 |
forceDownsample | false | false | false | false |
lossless | false | false | false | true |
grayscale | false | false | false | false |
reduceColor | true | true | true | true |
clipImages | false | true | true | false |
preferJpx | true | true | true | false |
removeAlternates | false | false | true | false |
flattenIcc | true | true | true | false |
rasterizePages | false | false | false | false |
rasterizeDpi | 150 | 150 | 150 | 150 |
rasterizeQuality | 50 | 50 | 50 | 50 |
rasterizeText | false | false | false | false |
subsetFonts | true | true | true | true |
removeStandardFonts | false | false | true | false |
unembedAliasedFonts | false | false | true | false |
mergeFonts | true | true | true | true |
removeAnnots | false | false | false | false |
flattenForms | false | false | false | false |
flattenLinks | false | false | false | false |
removeSignatures | false | false | false | false |
removeStructTree | false | false | false | false |
removeThreads | false | false | true | false |
removeThumbnails | true | true | true | true |
removeAppData | true | true | true | true |
removeSpiderInfo | false | false | true | false |
removeOutputIntents | false | false | false | false |
preserveConformance | false | false | false | false |
brotli | false | false | false | false |