Compressing Large PDFs

Here is a nifty Automator action that I created today to automatically compress large PDFs that I encounter every now and then from journals. These are not scanned images that JSTOR produces, which are understandably large. They are articles typically less than 10 pages, with a few images. They have no business exceeding 1MB, never mind 7MB(!) which I downloaded once. After compression they are often around 700KB. You can compress using Acrobat Pro, but this is free and much faster. Here is the commandline using Ghostscript:

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

This uses the "printer" setting, which downsamples at 300DPI. Ebook is 150DPI. There is also prepress which I haven't used but I'm guessing 600DPI? Hard disk space is cheap these days but there are a couple of practical reasons to do this: sharing with others, and screen rendering speed. In particular Preview slows to a crawl at times.

After getting tired enough of deleting and renaming the files by hand, I created a Leopard Automator action for this. Now I can just select the file, and it will convert and replace the original.