TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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
up vote 4 down vote accepted

You can use external tools like Ghostscript:

gs -sOutputFile=output-filename -sDEVICE=pdfwrite -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray -dCompatibilityLevel=1.4 input-filename < /dev/null
share|improve this answer

pdftex can not change the colour model of included pdfs; you have to use external tools. This (manipulate the internals of included pdfs) might be theoretically possible with LuaTeX, but I strongly advise against it.

share|improve this answer
Thanks. May I ask you why you advise against it? – cjorssen Oct 18 '13 at 22:12
@cjorssen: How would you change the colour model of included pdfs? You'd probably have to rewrite the complete content stream. There be dragons... – Martin Schröder Oct 19 '13 at 11:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.