Skip to content

pwasuite/pdftools

 
 

Repository files navigation

pwasuite/pdftools, repository of pdf.pwasuite.com

Try it: PDF Tools right into the browser

Context

This project is another usage of the gs.wasm that @ochachacha compiled. It is based on a fork of Laurent Meyer's demo of PDF compression right into the browser.

It provides many tools for PDF manipulation, right into the browser:

  • compression/minfication
  • merge multiple PDF files into one
  • split PDF into individual pages
  • extract page ranges
  • convert PDF to grayscale
  • change page size

It applies ghostscript commands such as:

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

Exact command varies based on user input and use case.

WebWorker

The compression is processed in a webworker so that the main thread doesn't become unresponsive and 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 https://github.com/pwasuite/pdftools.git
cd pdftools
npm install
npm run build # static content in dist folder
npm run dev # start vite dev server

Try it online

https://pdf.pwasuite.com/

About

PDF Tools by PWASuite - In browser PDF Toolbox using Ghostscript WASM - We use Laurent Meyer's repo as a starting point https://github.com/laurentmmeyer/ghostscript-pdf-compress.wasm

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • JavaScript 92.9%
  • CSS 6.9%
  • HTML 0.2%