Compressing scanned PDF files on OSX

I've been scanning a lot of documents using preview recently(!) and the resulting PDFs are often super huge. You can always use one of the online PDF compressing services if you only have a few documents. However, this can get really slow if you have a significant number of docs to process. Or you can use ghostscript :)

Install Ghostscript

brew update  
brew install gs  

Compress!

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

Refer the ghostscript manual for more info.