subik hosting platform family and friend web hostingSerious Problems with this site:
abuse@subik.at.removetherest.br

compress pdf on the command line

This is a quick note to myself … when I have to compress PDFs again (e.g. to send out CVs), this command made my day … and the PDF from 2.6 MB to 77KB!

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=~/compressed.pdf ~/fromprinterdriver.pdf

I found it on the address below … there is also an explanation for the PDFSETTINGS switch.
I didn’t even have to remove quiet or batch to see warnings, it just works.

http://www.smartjava.org/content/compress-pdf-mac-using-command-line-free

BTW: it works on linux and osx identically, IF you have installed ghostscript (which I have from macports). YMMV if you try this on windows, b/c getting Ghostscript to run there is out of the scope of this blog post.

Comments are closed.