Reduce PDF size using ghostscript

Courtesy of Jenny:

Note: don’t use if you have transparency in your figures.

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