Created
April 2, 2019 08:55
-
-
Save Leandros/c93ad782192b356d7e2ff36702e4ca10 to your computer and use it in GitHub Desktop.
Compress PDF (requires ghostscript)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
readonly input="$1" | |
readonly output="$2" | |
readonly preset="$3" | |
if [ "$input" = "" ] || [ "$output" = "" ] || [ "$preset" = "" ]; then | |
echo "usage: $0 [input file] [output file] [screen|ebook|printer|prepress]" | |
exit 1 | |
fi | |
gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dPDFSETTINGS=/${preset:-"screen"} -dCompatibilityLevel=1.4 -sOutputFile="$output" "$input"\ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment