Skip to content

Instantly share code, notes, and snippets.

@luikore
Created October 31, 2014 07:04
Show Gist options
  • Save luikore/2db553db2788e6620113 to your computer and use it in GitHub Desktop.
Save luikore/2db553db2788e6620113 to your computer and use it in GitHub Desktop.
shrink pdf size
# need to install ghostscript first
pdf-shrink() {
if [[ -e $1 ]]; then
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=$2 $1
else
echo 'usage: pdf-shrink in.pdf out.pdf'
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment