BROWSER JS SDK

Document imaging that runs in the browser.

Compress, convert, view, and reorganize documents entirely on the user's device. Images (JPEG, PNG, TIFF) and PDF go in; PDF, TIFF, or JPEG come out. Files are read into memory and processed in the page, no upload, no server round-trip, and it keeps working offline.

WHY IN THE BROWSER

The page never leaves the device

The SDK is compiled to WebAssembly and executes on the user's machine. That single fact changes the privacy story, the cost model, and the feel of the product.

No uploads

Documents are read into a byte array and processed in the page. Nothing is transmitted, so sensitive files never become someone else's compliance problem.

No per-page server cost

Processing runs on hardware you don't pay for or scale. There is no queue, no worker fleet, and no bandwidth bill that grows with page volume.

Works offline

Once the SDK files have loaded, no network is required. Field apps, kiosks, and branch machines on poor links keep processing documents.

Instant feedback

No round-trip means the result is there as soon as it is computed. Page streaming hands each page to your UI as it finishes rather than at the end.

RUN MODES

Two run modes. The same API.

Pick one entry point per page. Both expose the same method names and the same response contract, switching is a change of import, not a rewrite.

Instant, in-page

Runs on the main thread. The simplest setup: one document at a time, small tools, quick utilities. A large job will block the UI while it runs, which is a fair trade when the job is short.

This mode also exposes a few extras: a page count straight from a File, EXIF-rotation toggles, and a reset to defaults.

Background, worker pool

Spawns a pool of workers and keeps the UI responsive. Built for bulk and parallel processing, fan a task out per file and await them together. Configuration setters broadcast to every worker.

Input buffers are transferred to the worker, so a buffer is detached on the caller side afterwards. Re-read the file if you need those bytes again.

Same contract in both modes

Every method is async and resolves to { STATUS, DESCRIPTION, DATA }. A failure never throws across the API, you inspect STATUS and read DESCRIPTION instead of wrapping calls in try/catch.

QUICKSTART

Files in, PDF out

const helper = new ImageWizHelper();
await helper.ready;
await helper.initialize(LICENSE_BLOB);

await helper.SetDPI(300);
await helper.SetFilter(0);           // Normal

const buffers = await Promise.all(
  [...files].map(async f =>
    new Uint8Array(await f.arrayBuffer()))
);

const res = await helper.compressToPdf(buffers);
if (res.STATUS) {
  save('out.pdf', res.DATA, 'application/pdf');
} else {
  console.error(res.DESCRIPTION);
}
// every method resolves to this shape
{
  STATUS:      true,
  DESCRIPTION: "SUCCESS",
  DATA:        …   // shape per method
}

// compressToPdf, compressToTiff, ocrbw
//   → Uint8Array
// compressToJPG
//   → Uint8Array[] (one JPEG per page)

// inspect a document before you touch it
const info = await helper.readImageInformation(buf);

info.DATA.TOTAL_PAGES   // 14
info.DATA.FILESIZE      // KB
info.DATA.INFORMATION   // per page:
                        //   PAGE_NO, WIDTH, HEIGHT,
                        //   COLOR_TYPE, DPI

The same three lines start either mode, construct, await ready, then initialize. Which file you load decides whether the work runs in the page or across the worker pool.

FAQ

Questions developers ask first

Do documents ever leave the user's browser?
No. The SDK runs as WebAssembly on the user's device. Files are read into memory as byte arrays and processed in the page, there is no upload step and no server round-trip. Once the SDK files have loaded, the SDK keeps working with no network at all.
What can I pass in, and what comes back?
Any common image or document format, read as byte arrays, JPEG, PNG, single- or multi-page TIFF, and PDF. Multi-page inputs fan out per page: the JPEG method returns one image per page, while the PDF and TIFF methods combine every input into a single multi-page output. A query method reports file size in KB, total pages, and per-page width, height, DPI, and color type (BW, GREYSCALE, or COLOR).
How do I handle errors?
Every method is async and resolves to an object with STATUS, DESCRIPTION, and DATA. Failures never throw across the API, so there is nothing to catch, check STATUS, read DESCRIPTION for the message, and use DATA, which is populated on success only.
What happens without a license key?
Initialization is non-fatal. If the license blob is missing or rejected, the SDK still initializes and every operation still works, the output simply carries a watermark band. That makes it straightforward to build and demo the whole flow before licensing. A license blob must match the SDK version to fully unlock; talk to us about licensing.
Which run mode should I choose?
Use the instant in-page mode for single documents, small tools, and the simplest possible setup, accepting that a big job blocks the UI while it runs. Use the background worker pool for bulk or parallel processing and a UI that stays responsive. Method names and the response contract are identical; a handful of convenience methods, such as reading a page count straight from a File and the EXIF-rotation toggles, exist only in instant mode.
How much control do I have over the output?
Set the output DPI, choose a page layout from A0 to A6 or a custom pixel size with stretch or aspect-fit behavior, and apply a color filter, Normal, Black & White, or Grayscale. Filters are applied per page during compression, so a black-and-white filter followed by a TIFF write produces a black-and-white TIFF.
What are the hosting requirements?
Serve the SDK files over HTTP or HTTPS, opening a page from file:// will not load the WebAssembly module. The loader resolves its companion files relative to its own URL, so keep them together in one directory. There is no backend to deploy and no infrastructure to scale.

Build it on the device

Get a key and wire the SDK into a page today. Unlicensed builds run every operation, output is watermarked until you license.