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

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s