I arrived at this solution recently when looking to compress a massive print-quality PDF for the web.

If you search for “compressing pdf files on mac” you’ll get lots of bad results. There are lots of paid applications out there that claim to be able to do this, but they’re (obviously) not free.

If you’re not afraid to get your hands dirty in the terminal you can compress your PDF files from your terminal with a single command. If you find youself needing to do this often, I’ve got a function that I put together to make this easier.

The method I’m using requires ghostscript. Ghostscript is a high quality, high performance Postscript and PDF interpreter and rendering engine [1].

If you’re using a Mac, you can install ghostscript using brew:

brew install ghostscript

If you’re using Linux you can install ghostscript from aptitude, or your package manager of choice [2].