Monthly Archives: March 2013

Reducing PDF file size

I just needed to reduce a PDF file size (because it had several high res images on it), and found these two solutions:

http://askubuntu.com/questions/113544/how-to-reduce-pdf-filesize http://www.alfredklomp.com/programming/shrinkpdf/

The last solution, a shell script worked nicely and reduced my PDF file size from 20MB to 2MB!!!

Here’s the script that I copied from the site above:

#!/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 \
$1

$ sh shrinkpdf.sh yourfile.pdf