gs \ -sOutputFile=output.PDF \ -sDEVICE=pdfwrite \ -sColorConversionStrategy=Gray \ -dProcessColorModel=/DeviceGray \ -dCompatibilityLevel=1.4 \ input.PDF < /dev/null