This is a fork of ghostscript-wasm that uses ESM instead of CommonJS and with TypeScript typing.
Since Ghostscript is huge wasm, it is NOT embedded in JS. You need to copy gs.wasm to a public directory of your app.
It is adjusted for the browser and has the following differences due to changes in build options:
- It is an ES module instead of a CommonJS module.
- It names the exported default function
gsinstead ofModule(default name). - It build
gs.mjsinstead ofgs.js. - It accepts overloading of the
printandprintErrmethods. - It provides TypeScript typing
Build with docker (run ./docker_build.sh) and run see the tests/test.html.
ghostscript compiled to WASM via Emscripten.
npm install --save ghostscript-wasm-esmSee the tests directory for examples.