This project takes any PDF and compresses it locally in your browser via ghostscript. This fork builds on the work of laurentmmeyer but uses the gs.wasm
compiled by ghostpdl-wasm.
The applied command is:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
To run the project, simply do the following steps
git clone https://github.com/jkrimmer/ghostscript-pdf-compress.wasm
cd ghostscript-pdf-compress.wasm
yarn
yarn dev
https://laurentmmeyer.github.io/ghostscript-pdf-compress.wasm/
laurentmmeyer wrote a post about the process.