@wasm-zoo/ghostscript
v0.7.2
Published
Ghostscript 10.08.0 compiled for browser WebAssembly by WASM Zoo, with Consumer API v1 and bundled runtime assets.
Maintainers
Readme
@wasm-zoo/ghostscript
Unofficial WASM Zoo distribution of the Ghostscript gs CLI for browsers. This package is backed by Ghostscript 10.08.0, Zoo builder 0.7.2, and the reviewed browser-full Release asset.
Install
npm install @wasm-zoo/ghostscriptUse
import { load } from "@wasm-zoo/ghostscript";
const gs = await load();
try {
const result = await gs.exec([
"-dSAFER", "-dBATCH", "-dNOPAUSE",
"-sDEVICE=png16m", "-r150",
"-sOutputFile=/out/page.png", "/input.pdf"
], {
files: [{ name: "/input.pdf", data: pdfBytes }],
dirs: ["/out"],
outputs: ["/out/page.png"]
});
console.log(result.files[0]);
} finally {
gs.dispose();
}The default entry imports the reviewed browser wrapper and uses static new URL(..., import.meta.url) references so modern bundlers can emit gs-core.js, gs-core.wasm. For manual/self-hosted deployments use @wasm-zoo/ghostscript/self-hosted and the Consumer API v1 baseUrl contract.
No SharedArrayBuffer or cross-origin isolation is required. Each gs command runs in an isolated Web Worker with MEMFS. The bundled Ghostscript WebAssembly binary is AGPL-3.0-or-later; review the bundled LICENSE-Ghostscript.txt and THIRD-PARTY-LICENSES/ notices before redistribution.
