#!/bin/bash if [ -z "$1" ] && [ -z "$2" ] && [ -z "$3" ] then echo "" echo "usage: pdf-shrink input.pdf output.pdf quality" echo " quality : screen = screen-view-only quality, 72 dpi images" echo " ebook = low quality, 150 dpi images" echo " printer = high quality, 300 dpi images" echo " prepress = high quality, color preserving, 300 dpi images" echo "" else /usr/bin/gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -dPDFSETTINGS=/$3 -sOutputFile=$2 $1 fi