@cloudpdf/engine
The CloudPDF engine: a browser client that speaks the Engine v3 interface
over HTTPS to a @cloudpdf/server
deployment (or the CloudPDF SaaS). Same AbortablePromise-based,
EngineError-coded contract as the local WASM engine
(@embedpdf/engine) — the
two are parity-tested against the shared conformance harness, so viewers and
application code work with either.
No WebAssembly, no Web Workers: rendering happens server-side.
npm install @cloudpdf/engine
import { cloudEngine } from '@cloudpdf/engine';
const engine = cloudEngine({
baseUrl: 'https://api.cloudpdf.com',
});
const document = await engine.open({ kind: 'token', token: docScopedJwt });
Inject it into the EmbedPDF viewer exactly like any other engine:
EmbedPDF.init({
target: '#viewer',
engine: () => cloudEngine({ baseUrl }),
});
Documentation
License
Apache-2.0 — see LICENSE.
Everything CloudPDF ships to a browser is open source; everything that runs on a
server is commercial. This package is the browser client, so it is Apache-2.0 —
free to read, vendor, and fork. It talks to a
@cloudpdf/server deployment,
which is the commercial part: the CloudPDF SaaS, or a server you self-host under
a separate written agreement.
(Contributors: this package's integration tests boot a real server, so pnpm test here needs @cloudpdf/server — a dev dependency that is not Apache-2.0.
The client source and its published dist are.)