Convert a DeviceN image to RGB.
int pdfGetDeviceNToRGBBitmap(PDFHandle pdf, int rowPad, PDFImageHeader *imgHdr, char **bits)
This function converts the DeviceN bitmap generated by the last call to pdfConvertPageToDeviceNImage to RGB.

The bitmap will be a 24-bit RGB bitmap, handled in the same way as for pdfConvertPageToBitmap2 in pdfImageRGB mode:

By default, this function will return the same thing as pdfConvertPageToBitmap2 in pdfImageDevNToRGB mode. The difference is that individual color channels can be removed with pdfRemoveDeviceNChannel.

The caller is responsible for freeing the bits pointer after using it, by calling pdfFreeMemory.

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); if ( ... ) { pdfRemoveDeviceNChannel(pdf, i); } } pdfGetDeviceNToRGBBitmap(pdf, 4, &hdr, &bits); ... use the bitmap ... /* the bitmap memory must be freed when you are finished */ pdfFreeMemory(bits); /* free the internal storage used by pdfConvertPageToDeviceNImage */ pdfClearDeviceNImage(pdf);