ghostscript-pdf-compress.wasm
ghostscript-pdf-compress.wasm copied to clipboard
Ghostscript 10 based on https://github.com/jkrimmer/ghostpdl-wasm
trafficstars
It is an experiment as asked by #6 and based on the amazing work of @jkrimmer. Linked with @jkrimmer/ghostpdl-wasm#1
- [x] Seems to roughly work
- [x] is based on https://github.com/jkrimmer/ghostpdl-wasm and https://github.com/jkrimmer/ghostscript-pdf-compress.wasm
- [x] is using Ghostscript (GIT PRERELEASE 10.05.0 (2024-09-18))
- [x] Supports Webworker (based on ghostpdl-wasm):
export GS_LDFLAGS="\
-s EXIT_RUNTIME=0 \
-s ALLOW_MEMORY_GROWTH=1 \
-s STACK_SIZE=256kb \
-s WASM=1 \
-s STANDALONE_WASM=0 \
-s ERROR_ON_UNDEFINED_SYMBOLS=1 \
-s WASM_BIGINT=1 \
-s FORCE_FILESYSTEM \
-s EXPORT_ES6 \
-s ENVIRONMENT='worker' \
-s MODULARIZE=1 \
-s EXPORT_NAME=gs \
-s INVOKE_RUN=0 \
-s EXPORTED_RUNTIME_METHODS='["callMain","FS"]' \
-s EMULATE_FUNCTION_POINTER_CASTS \
-s BINARYEN_EXTRA_PASSES="--pass-arg=max-func-params@70" \
--closure 1 \
"
- [ ] FS.writeFile is not present, I had to patch it in JS, not sure why, ideas welcome