Skip to content

Instantly share code, notes, and snippets.

@dingzeyuli
Created March 20, 2018 22:17
Show Gist options
  • Save dingzeyuli/c0fc9f6df357c061e4a0d46fe74ab32b to your computer and use it in GitHub Desktop.
Save dingzeyuli/c0fc9f6df357c061e4a0d46fe74ab32b to your computer and use it in GitHub Desktop.
mv "$1" "$1".ori.pdf
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.6 -dPDFSETTINGS=/prepress -sOutputFile="$1" "$1".ori.pdf
# the PDFSETTINGS can be set to following values for different compression ratio.
# largest printer / prepress
# mid-size ebook
# smallest screen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment