I am writing software to extract text sections from PDFs and render on screen for analysis; I need to display the text on screen in the colour from the document.
When the PDF contains CMYK colours at the moment I am using the simple formula widely found on the web (eg here) which is:
R = 255 × (1-C) × (1-K)
And similarly for the other colours.
However this is giving poor results. For example, one sample I have is specified in the PDF document with the command "0.62 0 0.05 0 k" (ie those are the CMYK components on a 0-1 scale). The formula above converts this to an RGB of #60fff2. However Adobe Reader renders this text using RGB #3dc6ea. Not only do these look very different, my colour is so bright that the text is hard to read. I've tried this on several monitors, and although there is variation in the colours, the overall result is the same: PDF reader shows a light pastel or sky blue, whereas the above conversion gives a bright cyan.
To verify this wasn't due to something missed in the PDF I tried the same colour in Illustrator: entering a CMYK of (62%, 0%, 5%, 0%) rendered on screen as #3ec6ea. Changing the colour editing box to RGB showed values of #40c4e8; and this was also rendered if I changed the colour settings to "Color Monitor". That's 3 different results from Adobe - but the differences are tiny and should be imperceptable.
So, are there any feasible alternative conversions which would give results closer to the Adobe conversions? I'm aware that conversion between RGB and CMYK is problematic, but this case is somewhat helped in that:
the conversion is for on-screen display only. Outputs won't be printed.
Differences between monitors are not very important. If a colour is rendered poorly on a certain monitor in (for example) Adobe Reader then I'm not expecting to produce a good result.
An exact match is irrelevant for me: I just need a conversion that looks similar and is readable.