Skip to content

Instantly share code, notes, and snippets.

@mabroor
Created January 25, 2012 15:05
Show Gist options
  • Save mabroor/1676669 to your computer and use it in GitHub Desktop.
Save mabroor/1676669 to your computer and use it in GitHub Desktop.
Shrink the size of a big pdf
#!/bin/sh
# usage:
# sh shrinkpdf.sh yourfile.pdf
# credit:
# http://www.alfredklomp.com/programming/shrinkpdf/
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment