Shrinkpdf: shrink PDF files with GhostscriptThe simplest shell script in the world to shrink your PDFs (as in reduce filesize) under Linux with Ghostscript. Inspired by some code I found in an OpenOffice Python script (I think). It feeds an existing PDF through Ghostscript, downsamples the images to 72dpi, and does some other stuff. Pretty straightforward.
shrinkpdf.shDownload the script by clicking the filename at the top of the box.
#!/bin/sh gs -q -dNOPAUSE -dBATCH -dSAFER \ -sDEVICE=pdfwrite \ -dCompatibilityLevel=1.3 \ -dPDFSETTINGS=/screen \ -dEmbedAllFonts=true \ -dSubsetFonts=true \ -dColorImageDownsampleType=/Bicubic \ -dColorImageResolution=72 \ -dGrayImageDownsampleType=/Bicubic \ -dGrayImageResolution=72 \ -dMonoImageDownsampleType=/Bicubic \ -dMonoImageResolution=72 \ -sOutputFile=out.pdf \ $1Usage
If it's not downloading just right click and 'save link as', make sure the file are in 'home' folder.
This produces a shrunken file named
sh shrinkpdf.sh yourfile.pdf
out.pdfin the current directory.
Sorry, Windows users; this one is Linux only. Ghostscript does run under Windows, but I don't know much about Windows scripting. You could try typing all these parameters on the commandline by hand.
You can increase the quality by changing the '72' number in the script to what ever number you want (ex: 120) for better image quality.
Credit goes to http://www.alfredklomp.com/programming/shrinkpdf/