I have a CMYK color PDF file (with one page and image only, no text).
I want to get the CMYK color value of a 'pixel' in this PDF file (I call a position as 'pixel'), currently I do it as follow:
- Convert the PDF page to bitmap <br>
- Get the color value of this pixel:
Color cPixel = bmpImage.GetPixel(x, y);
Finally, I convert the cPixel (RGB) into CMYK value, however the value is not correct :( (in original file it's 100%K, but the result is very different). I think the problem comes from my processing: CMYK file => Processing in RGB (convert to bitmap, read color in RGB) => Convert result into CMYK. The formula is used to convert from RGB->CMYK is:
Black = minimum(1-Red,1-Green,1-Blue)
Cyan = (1-Red-Black)/(1-Black)
Magenta = (1-Green-Black)/(1-Black)
Yellow = (1-Blue-Black)/(1-Black)
Now, I want to read CMYK value directly from PDF, please help me if you have any ideas! Thanks in advance for reading and any supporting.
Thank you so much!!!