Created
October 7, 2020 08:05
-
-
Save mjm522/818ab694fc40f60d6100a17793c6e8a3 to your computer and use it in GitHub Desktop.
Bash function to compress pdf
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
function compress_pdf() | |
{ | |
input_file=$1 | |
output_file=$1_compressed.pdf | |
level=/$2 | |
#levels: screen > ebook > printer > prepress, | |
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=$level -sOutputFile=$output_file $input_file | |
echo "Saved in the same folder with name $output_file" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment