# Option cmyk for xcolor package does not produce a CMYK PDF

I am trying to produce a CMYK PDF file to pass onto a printshop.

When I use the [cmyk] option for the xcolor package, the colours in the resulting PDF do look muted and less vibrant as is the case with the CMYK colorspace. For example,

\documentclass{minimal}
\usepackage[cmyk]{xcolor}
\begin{document}
\textcolor{blue}{\fontsize{24}{28}\selectfont A}
\end{document}


when processed by pdflatex produces a PDF file that appears onscreen like a muted, darkish CMYK colorspace document, but when I run ImageMagick's identify command on the PDF using

identify -verbose cmyk.pdf | grep Colorspace


I get

Colorspace: RGB


Surely the PDF uses only one of CMYK or RGB for colour. How can I reliably tell which?

Also, if it is indeed an RGB PDF why does it appear so different from the version I get if the line

\usepackage[cmyk]{xcolor}


is replaced by

\usepackage[rgb]{xcolor}


-
tex.stackexchange.com/questions/9961/pdf-colour-model-and-latex has a lot to say about color and PDF. – Christian Lindig Mar 9 '11 at 18:45

With using \pdfcompresslevel=0 I'll get the pdf with no compressed streams and can see what happens inside the pdf.

With the cmyk option I get:

stream
0 0 0 1 k 0 0 0 1 K
0 g 0 G
0 0 0 1 k 0 0 0 1 K
1 1 0 0 k 1 1 0 0 K
BT
/F15 24.7871 Tf 91.925 752.955 Td [(A)]TJ
0 0 0 1 k 0 0 0 1 K
0 0 0 1 k 0 0 0 1 K
0 0 0 1 k 0 0 0 1 K
ET
endstream


and with the rgb option:

stream
0 0 0 rg 0 0 0 RG
0 g 0 G
0 0 0 rg 0 0 0 RG
0 0 1 rg 0 0 1 RG
BT
/F15 24.7871 Tf 91.925 752.955 Td [(A)]TJ
0 0 0 rg 0 0 0 RG
0 0 0 rg 0 0 0 RG
0 0 0 rg 0 0 0 RG
ET
endstream


which is what I would expect, a correct color setting. But printing a RGB color is not the same as printing a CMYK color ...

-
 How did you get that? – Yiannis Lazarides Mar 9 '11 at 21:40 \pdfcompresslevel=0 – Herbert Jan 18 at 7:19

There's not really such a thing as a 'CMYK PDF' or an 'RGB PDF'. PDFs can contain objects coloured in RGB and CMYK (and many other) colour spaces. See my answer here for some details. So your statement "Surely the PDF uses only one of CMYK or RGB for colour." is wrong, and it's unclear to me on what basis "identify -verbose" is deciding that it is RGB. Maybe the colorspace just defaults to RGB, even for formats where that doesn't make sense?

As for your question: "How can I reliably tell which?", in addition to @Herbert's suggestion to look at the uncompressed PDF stream (if that means anything to you) you can use Adobe Acrobat Professional has various tools to see which colour spaces are being used and where. An "Output preview" tool; a "Preflight" tool; a "convert colors" tool; etc.

-
 Thank you for setting me right. Is there a Linux-friendly software package to do what Adobe Acrobat Professional does above? Thanks. – chandra Mar 14 '11 at 14:47 +1---I just ran identify on a PDF created with ConTeXt using only CMYK colors and got Colorspace: RGB as well. Makes me suspect ImageMagick isn't telling the whole story. – Sharpie May 9 '11 at 4:56