Created
July 6, 2018 13:14
-
-
Save bencholmes/d3f5dddad7669e5ebe30f94f9ed7a1f0 to your computer and use it in GitHub Desktop.
Bash script to convert a PDF from colour to gray scale.
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
fileName=$(basename $1) | |
directory=$(dirname $1) | |
gs \ | |
-sOutputFile="$directory/${fileName%.*}-grayscale.pdf" \ | |
-sDEVICE=pdfwrite \ | |
-sColorConversionStrategy=Gray \ | |
-dProcessColorModel=/DeviceGray \ | |
-dCompatibilityLevel=1.4 \ | |
-dAutoRotatePages=/None \ | |
-dNOPAUSE \ | |
-dBATCH \ | |
"$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment