Skip to content

Instantly share code, notes, and snippets.

@gsdefender
Created June 22, 2017 17:37
Show Gist options
  • Save gsdefender/69d7ef6523aeebba77cb26fec9b28c07 to your computer and use it in GitHub Desktop.
Save gsdefender/69d7ef6523aeebba77cb26fec9b28c07 to your computer and use it in GitHub Desktop.
A way to reduce the size of PDF sizes
#!/usr/bin/env bash
# $3 must be one of: screen, ebook, printer, prepress, from lower to higher quality
# h/t: https://www.techwalla.com/articles/reduce-pdf-file-size-linux
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS="/$3" -sOutputFile="$2" "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment