Created
August 6, 2017 12:50
-
-
Save Ortham/b51264a8e833c5c4bb9e0501d0220798 to your computer and use it in GitHub Desktop.
A script for slimming PDFs (eg. of scanned documents)
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
ls -1 *.pdf | (IFS=: ; while read FILENAME; do s=${FILENAME##*/} ; gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=${s%.pdf}.2.pdf ${FILENAME} && mv ${s%.pdf}.2.pdf ${FILENAME} ; done) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment