pdfSetDeviceNChannelCMYK
Replace the CMYK value associated with a DeviceN channel.
void pdfSetDeviceNChannelCMYK(PDFHandle pdf, int channelIdx, unsigned int cmyk)
This function replaces the CMYK color associated with DeviceN channel
#
channelIdx
. The new CMYK value will be used in
subsequent calls to pdfGetDeviceNToRGBBitmap
and
pdfWriteDeviceNToRGBBitmap
.
The CMYK argument is a 32-bit integer, with one byte per CMYK
component: 0xCCMMYYKK
.
Use pdfGetNumDeviceNChannels
, pdfGetDeviceNChannelName
, and
pdfGetDeviceNChannelCMYK
to examine the available channels.
C:
err = pdfConvertPageToDeviceNImage(pdf, pageNum, dpi);
if (err != pdfOk) {
/* handle the error */
...
}
/* change channel 4 to 100% magenta */
pdfSetDeviceNChannelCMYK(4, 0x00ff0000);
pdfWriteDeviceNToRGBBitmap(pdf, pdfImageFilePNG, "out.png");
/* free the internal storage used by pdfConvertPageToDeviceNImage */
pdfClearDeviceNImage(pdf);