summaryrefslogtreecommitdiff
path: root/localps2pdfprepressgray
diff options
context:
space:
mode:
Diffstat (limited to 'localps2pdfprepressgray')
-rwxr-xr-xlocalps2pdfprepressgray16
1 files changed, 16 insertions, 0 deletions
diff --git a/localps2pdfprepressgray b/localps2pdfprepressgray
new file mode 100755
index 0000000..f187da0
--- /dev/null
+++ b/localps2pdfprepressgray
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -eu
+
+infile="$1"
+outfile="${2:-$(basename "$infile" .pdf)_gray.pdf}"
+
+# https://stackoverflow.com/questions/20128656
+gs \
+ -sDEVICE=pdfwrite \
+ -dPDFSETTINGS=/prepress \
+ -sProcessColorModel=DeviceGray \
+ -sColorConversionStrategy=Gray \
+ -dOverrideICC \
+ -o "$outfile" \
+ -f "$infile"