Compressing PDF Files using MacOS or Linux
The method I’m using requires ghostscript
. Ghostscript is a high quality, high performance Postscript and PDF interpreter and rendering engine.
If you’re using a Mac, you can install ghostscript
using brew
:
If you’re using Linux you can install ghostscript
from aptitude
, or your package manager of choice.
Now, you can use ghostscript
to compress your PDF file for the web:
That’s not exactly a memorable command, so I’ve made a function that you can add to your ~/.bash_profile
to allow you to easily compress PDF files from your terminal:
Now you can simply run the following command:
Using this command I managed to compress an A3 size PDF (originally around 9MB) down to just under 1MB, which is perfect for the web.
Last updated
Was this helpful?