Created
April 19, 2017 21:40
-
-
Save neulaender/4211944e8c09747042e3cf896c371289 to your computer and use it in GitHub Desktop.
Compress PDFs in bash
This file contains hidden or 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
# compress PDF. Needs ghostscript package. | |
gs -sDEVICE=pdfwrite -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -DBATCH -sOutputFile=out.pdf in.pdf | |
# compress all PDFs in dir | |
for file in `ls *.pdf`; | |
do | |
gs -sDEVICE=pdfwrite -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -DBATCH -sOutputFile=${$file%.pdf}-c.pdf $file | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment