I use pdftk to compress a pdf using the following command line
pdftk file1.pdf output file2.pdf compress
It works as the w
After trying gpdf as nullglob suggested, I found that I got the same compression results (a ~900mb file down to ~30mb) by just using the cups-pdf printer. This might be easier/preferred if you are already viewing a document and only need to compress one or two documents.
In Ubuntu 12.04, you can install this by
sudo apt-get install cups-pdf
After installation, be sure to check in System Tools > Administration > Printing > right-click 'PDF' and set it to 'enable'
By default, the output is saved into a folder named PDF in your home directory.