Skip to content

Instantly share code, notes, and snippets.

@fedir
Last active October 8, 2019 13:07
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 fedir/356af183677ac278b5cdbaf121fc0fa7 to your computer and use it in GitHub Desktop.
Save fedir/356af183677ac278b5cdbaf121fc0fa7 to your computer and use it in GitHub Desktop.
PDF compression with gs (works well on Linux Mint)
# Compressing to EBook quality (between "screen" and "preprocess")
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
# Black and white output, with custom resolution
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dCompressFonts=true -r150 -dNOPAUSE -dQUIET -dBATCH -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray -sOutputFile=output.pdf input.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment