Skip to content

Instantly share code, notes, and snippets.

@antenando
Created March 5, 2021 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antenando/688796d967333407c148d6cbfaef78ee to your computer and use it in GitHub Desktop.
Save antenando/688796d967333407c148d6cbfaef78ee to your computer and use it in GitHub Desktop.
# Usage: pdfcompress [input file] [output file] [screen*|ebook|printer|prepress]
pdfcompress() {
if [ -z "$1" ]||[ -z "$2" ]
then
echo "Usage: pdfcompress [input file] [output file] [screen*|ebook|printer|prepress]"
return 1
else
gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dPDFSETTINGS=/${3:-"printer"} -dCompatibilityLevel=1.4 -sOutputFile="$2" "$1"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment