Forum How do I...?

Get a grayscale PDF

sometimes I work with images in RGB or CMYK, and would like to export the PDF in grayscale.
Is there some way to do this?
Not yet, but we are currently investigating color conversion for the next release.
We now have a new --convert-colors option in the latest builds which will convert all the colors and images to use the ICC color profile specified by the --pdf-output-intent option, so you can specify a grayscale color profile and get a grayscale PDF.
hi Mike, thanks!
I've not been able to find a grayscale color profile that works. Existing ones I've found have a 'Display' profile class, and I assume Prince need one with a printer class.

Does anyone else have a source for a grayscale color profile, or guidance on how to create one?
It's fine to use a 'Display' class ICC profile with --convert-colors.

You can try Gray-elle-V2-srgbtrc.icc or others from the same repository.
Description here:

An example of an 'Output' class ICC profile is available here:
However, the result will probably be too dark unless you embed the ICC profile in the PDF and use a color managed PDF viewer.
How can I avoid that images are transformed?
I get an actual error with a "Display" class profile when trying to get a grayscale PDF/X-4:

error: invalid ICC profile class 'Display' for PDF/X-4 output intent

My Kingdom* for a 20% Dot Gain Grayscale output ICC profile!

*I don't actually have a Kingdom
Do downstream processors require such a profile? Do they happen to have one available? :D
Okay, sorry for bringing this up again, but I’m stuck with converting to grayscale.

I found the DotGain15 profile here:

And I integrated the following CSS:
prince-pdf-output-intent: url(data:application/vnd.iccprofile;base64,[...profile data goes here...]);
prince-pdf-page-colorspace: gray;
prince-pdf-color-conversion: all;
prince-pdf-profile: "PDF/X-4";

All data is properly converted to grayscale, BUT all texts with color: prince-overprint( cmyk(0,0,0,1) ); are converted to 94% K!

How can I preserve CMYK black while converting all RGB images to grayscale? Can someone please help me with this?

Thanks, Tobias
Currently we don't have a way to selectively convert only certain colors, so I think this will require converting the images separately outside of Prince or finding a different ICC profile with the desired CMYK conversion behaviour.
The Prince latest builds can now apply color conversion to individual elements! :D
For anyone looking for a good CMYK to grayscale profile, I found "ConvertToK_ISOcoated.icc" here:
Thanks, I tried --pdf-output-intent=ConvertToK_ISOcoated.icc, and indeed the output looks nice and gray. But what makes a "good" profile? Does it depend on some physical properties (paper, ink)? Is there a canonical grayscale conversion?
@cayhorstmann Yes, "good" was a bit sloppy of me. Profiles always depend on physical properties such as paper, press, etc. But you'll rarly find CMYK2Greyscale profiles at all. And this one was the only one, which preserved 100K texts as 100K, and converted over all tonal values of some test images fine for my needs.
So, it was "good" for my needs, but may be it's not for yours. Test it out thoroughly.
There are some additional grayscale ICC profiles mentioned in this thread: