pdfGetDeviceNChannelCMYK

Get the CMYK color of a DeviceN color channel.
unsigned int pdfGetDeviceNChannelCMYK(PDFHandle pdf, int channelIdx)
This function returns the CMYK value for the specified channel generated by the last call to pdfConvertPageToDeviceNImage.

The returned value is a 32-bit integer, with one byte per CMYK component: 0xCCMMYYKK.

C:
int nChannels, i; char *channelName; unsigned int channelCMYK; PDFImageHeader hdr; char *bits; int err; err = pdfConvertPageToDeviceNImage(pdf, pageNum, dpi); if (err != pdfOk) { /* handle the error */ ... } nChannels = pdfGetNumDeviceNChannels(pdf); for (i = 0; i < nChannels; ++i) { channelName = pdfGetDeviceNChannelName(pdf, i); channelCMYK = pdfGetDeviceNChannelCMYK(pdf, i); printf("channel %d: %s = %08x\n", channelName, channelCMYK); pdfGetDeviceNBitmap(pdf, i, 1, 0, &hdr, *bits); /* hdr and bits represent a grayscale bitmap -- similar to pdfConvertPageToBitmap2 with pdfImageGray */ /* each channel has an 8-bit bitmap; the bitmaps for all channels will have the same width and height */ ... /* the bitmap memory must be freed when you are finished */ pdfFreeMemory(bits); } /* free the internal storage used by pdfConvertPageToDeviceNImage */ pdfClearDeviceNImage(pdf);
pdfConvertPageToDeviceNImage
pdfGetNumDeviceNChannels
pdfGetDeviceNChannelName
pdfGetDeviceNBitmap
pdfClearDeviceNImage