Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.01 KB

Readme.md

File metadata and controls

34 lines (21 loc) · 1.01 KB

Ghostscript-pdf-compress.wasm

Context

This project is a demo of another usage of the gs.wasm that @ochachacha compiled. It takes any PDF and compress it via ghostscript.

The applied command is:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

WebWorker

The compression is now processed in a webworker so that the main thread doesn't become unresponsive and now there is virtually no limit to the size of the PDF that you can compress 🎉

Run the project

To run the project, simply do the following steps

git clone [email protected]:laurentmmeyer/ghostscript-pdf-compress.wasm.git
cd ghostscript-pdf-compress.wasm
yarn
yarn dev

Demo

https://laurentmmeyer.github.io/ghostscript-pdf-compress.wasm/

Blog

I wrote a post about the process.