# Change the color model of an included pdf

Say I have a pdf file foo.pdf that I want to include in my bla.tex document via \includegraphics{foo.pdf}. Say that foo.pdf is a colored document and that I need bla.pdf to be in gray levels. How can I do?

-
What about using Ghostscript as external tool: gs -sOutputFile=output-filename -sDEVICE=pdfwrite -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray -dCompatibilityLevel=1.4 input-filename < /dev/null –  susis strolch Oct 18 '13 at 20:59
Thanks, but I'd rather rely on pdftex (no external tool). BTW, your command output an error Error: /undefinedfilename in (sDEVICE=pdfwrite). –  cjorssen Oct 18 '13 at 21:09
@cjorssen: The option starts with a hyphen: -sDEVICE=pdfwrite –  Heiko Oberdiek Oct 18 '13 at 21:41
Indeed. Thanks. @susis strolch Would you mind turn you comment into an anwer as it seems to be the right way to do what I ask. –  cjorssen Oct 18 '13 at 22:11

You can use external tools like Ghostscript:

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

-