Easily Resize PDF on Mac OSX and Linux

On many occasions, you might want to resize a PDF to send it by Email or put it on the web. There are many useless Share- and Bloatware-tools (like Adobe Acrobat) that might or might not help you with that.

If you happen to work on a Linux, BSD or Mac OSX machine, you can simply use ghostscript for the task. It’s much faster and gets better filesizes than the Optimize-function of Adobe Acrobat.

All you need to do is to make sure ghostscript is installed and then put the following shortcut in your .profile or .bashrc in your home-directory.

pdfResize() {
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -dPDFSETTINGS=/$1 -sOutputFile=output.pdf $2
}

After that’s done, open a new Terminal-window and try the following command:

pdfResize screen MyDocument.pdf

You should now find the resized document in a file called output.pdf in the same directory.

The first argument sets the quality. Available options are screen, ebook and printer. While screen gives you the smalles file size, printer provides better quality at a reasonable filesize.