DOCUMENTATION · COMPRESSION SDK

Compression SDK integration guide.

Quickstart per language, configuration, format-specific notes, server processing, and hyperscaler marketplace API.

Other docs: Document AI APIs · Scanning SDK · Docs home

Overview

The Compression SDK is a compiled library distributed for .NET, Java, Node.js, and Go. Layout-preserving compression for PDF, TIFF, JPG, and PNG within PDFs. Designed for production server pipelines — multi-threaded, batch-capable, with predictable per-server licensing.

License + activation

The Server-side tier is licensed per production server. Domain Unlimited covers all servers within one organisation. Activation is offline-capable for air-gapped environments — request an activation file from the portal.

Free / Developer tier

For evaluation and local development only — watermarked output, single dev machine. Move to a paid tier when ready for production.

.NET (C#)

NuGet
dotnet add package Abscode.Compression
csharp
using Abscode.Compression;

var compressor = new PdfCompressor(licenseKey: "abs_comp_...");

var result = compressor.Compress(
    inputPath: "input.pdf",
    outputPath: "output.pdf",
    profile: CompressionProfile.Balanced
);

Console.WriteLine($"Reduced {result.OriginalSize} → {result.CompressedSize}");

Java

Maven
<dependency>
  <groupId>com.abscode</groupId>
  <artifactId>compression</artifactId>
  <version>1.0.0</version>
</dependency>
java
PdfCompressor compressor = new PdfCompressor("abs_comp_...");

CompressionResult result = compressor.compress(
    "input.pdf",
    "output.pdf",
    CompressionProfile.BALANCED
);

Node.js

npm
npm install @abscode/compression
javascript
import { PdfCompressor } from "@abscode/compression";

const compressor = new PdfCompressor({ licenseKey: "abs_comp_..." });

const result = await compressor.compress({
  input: "input.pdf",
  output: "output.pdf",
  profile: "balanced"
});

Go

go.mod
go get github.com/abscode/compression-go

Configuration

OptionValuesNotes
profilemin · balanced · maxTrade-off between size and quality
targetSizeBytesintegerCompress until target reached (overrides profile)
maxDpi72 / 150 / 300 / 600Downsample embedded images above this DPI
preserveLayoutbooleanDefault true — keeps text/table positions exact
preserveSearchablebooleanKeeps PDF text layer intact for OCR-readable PDFs
threadsintegerServer-side only — default = CPU count

Format-specific notes

PDF

Compresses embedded JPG/PNG layers, removes redundant fonts and metadata, optimises stream encoding. Preserves text layer, form fields, annotations, and bookmarks.

TIFF (single + multi-page)

CCITT G4 for B&W scans, JPEG for colour. Multi-page TIFFs processed as a single document, page tags preserved.

JPG / PNG within PDFs

Embedded images downsampled per maxDpi and re-encoded at the configured quality level.

Server processing

The Server-side tier unlocks multi-threaded processing, batch pipelines, and DPI / size-cap controls. Thread count defaults to your CPU count; tune via threads option.

Batch pipelines

csharp
var batch = new BatchCompressor(licenseKey: "abs_comp_...");

batch.EnqueueDirectory("/incoming", "/outgoing");
batch.OnDocumentCompressed += (s, e) => Log(e.Filename, e.SavedBytes);
await batch.RunAsync();

Hyperscaler Marketplace API (PAYG)

Same compression engine, exposed as a REST API on AWS, Azure, and GCP marketplaces. For cloud-native customers using Lambda / Functions / Cloud Run, or for procurement under existing cloud commitments (AWS EDP, Azure MACC).

curl
curl -X POST https://compress.abscode.com/v1/pdf \
  -H "Authorization: Bearer abs_comp_..." \
  -H "X-Marketplace: aws" \
  -F "file=@input.pdf" \
  -F "profile=balanced"

Billed per document through the marketplace at approximately $0.002–$0.005/document.

Versions

LanguageLatestPackage
.NET1.0.0Abscode.Compression
Java1.0.0com.abscode:compression
Node.js1.0.0@abscode/compression
Go1.0.0github.com/abscode/compression-go

This is a docs landing page

Full documentation will include per-method API reference, error code dictionary, marketplace billing docs, format-by-format tuning guides, and benchmark numbers per profile.