Skip to content

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 ​

OptionTypeDefaultWhat it does
imageQualitynumber 5 to 10080JPEG 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.
maxDpinumber 0 to 600150Images above this resolution are resampled down. 0 leaves resolution alone.
forceDownsamplebooleanfalseResample even when the image is only slightly above the limit.
losslessbooleanfalseTurns off quality, resolution and every other lossy image step.
grayscalebooleanfalseConvert images to grayscale.
reduceColorbooleanfalseReduce colour complexity where it does not change appearance.
clipImagesbooleanfalseCrop image data hidden outside the visible clip region.
preferJpxbooleanfalseLet JPEG 2000 compete with JPEG per image and keep the smaller one.
removeAlternatesbooleanfalseDrop alternate image versions.
flattenIccbooleanfalseFlatten 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.

OptionTypeDefaultWhat it does
rasterizePagesbooleanfalseReplace each page with a single rendered image. Shrinks vector-heavy pages dramatically.
rasterizeDpinumber 36 to 600150Render resolution. Higher keeps more detail.
rasterizeQualitynumber 1 to 10050JPEG quality for the rasterized pages.
rasterizeTextbooleanfalseRasterize pages even when the document has a text layer. Text stops being selectable and searchable, and links stop working. Needs rasterizePages.

Fonts ​

OptionTypeDefaultWhat it does
subsetFontsbooleanfalseKeep only the glyphs the document uses. Lossless by definition.
removeStandardFontsbooleanfalseUnembed the standard 14 PDF fonts; viewers supply them.
unembedAliasedFontsbooleanfalseUnembed metric-compatible clones of the standard fonts. Arial, Times New Roman and Courier New map to the built-in equivalents. Only applied when safe.
mergeFontsbooleanfalseMerge duplicate font programs and dictionaries.

Structure and interactivity ​

OptionTypeDefaultWhat it does
removeAnnotsbooleanfalseRemove comments and other annotations.
flattenFormsbooleanfalseFlatten form fields into page content. Form fields stop being fillable.
flattenLinksbooleanfalseFlatten link annotations. Links stop being clickable.
removeSignaturesbooleanfalseRemove 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.
removeStructTreebooleanfalseDrop the structure tree. Removes tagging, which screen readers rely on.
removeThreadsbooleanfalseRemove article threads.

Metadata and cleanup ​

OptionTypeDefaultWhat it does
removeThumbnailsbooleanfalseRemove embedded page thumbnails.
removeAppDatabooleanfalseRemove application-private data and piece info.
removeSpiderInfobooleanfalseRemove web capture information.
removeOutputIntentsbooleanfalseRemove output intents.

Output format ​

OptionTypeDefaultWhat it does
preserveConformancebooleanfalseKeep a PDF/A document conformant. Disables every step that would break the standard, including Brotli and rasterization; anything dropped is reported in warnings.
brotlibooleanfalsePDF 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.

Optionlowmediumhighlossless
imageQuality805020100
maxDpi200150720
forceDownsamplefalsefalsefalsefalse
losslessfalsefalsefalsetrue
grayscalefalsefalsefalsefalse
reduceColortruetruetruetrue
clipImagesfalsetruetruefalse
preferJpxtruetruetruefalse
removeAlternatesfalsefalsetruefalse
flattenIcctruetruetruefalse
rasterizePagesfalsefalsefalsefalse
rasterizeDpi150150150150
rasterizeQuality50505050
rasterizeTextfalsefalsefalsefalse
subsetFontstruetruetruetrue
removeStandardFontsfalsefalsetruefalse
unembedAliasedFontsfalsefalsetruefalse
mergeFontstruetruetruetrue
removeAnnotsfalsefalsefalsefalse
flattenFormsfalsefalsefalsefalse
flattenLinksfalsefalsefalsefalse
removeSignaturesfalsefalsefalsefalse
removeStructTreefalsefalsefalsefalse
removeThreadsfalsefalsetruefalse
removeThumbnailstruetruetruetrue
removeAppDatatruetruetruetrue
removeSpiderInfofalsefalsetruefalse
removeOutputIntentsfalsefalsefalsefalse
preserveConformancefalsefalsefalsefalse
brotlifalsefalsefalsefalse

Dual-licensed under AGPL-3.0 and Commercial License.