pdfWriteDeviceNToRGBBitmap

Convert a DeviceN image to RGB and write to an image file.
int pdfWriteDeviceNToRGBBitmap(PDFHandle pdf, int format, char *fileName)
This function converts the DeviceN bitmap generated by the last call to pdfConvertPageToDeviceNImage to RGB, and then writes it to an image file.

This function is very similar to pdfGetDeviceNToRGBBitmap, except that it writes the image to disk, rather then returning an in-memory bitmap.

The format and fileName arguments are the same as for pdfWritePageBitmap.

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

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); if ( ... ) { pdfRemoveDeviceNChannel(pdf, i); } } pdfWriteDeviceNToRGBBitmap(pdf, pdfImageFilePNG, "out.png"); /* free the internal storage used by pdfConvertPageToDeviceNImage */ pdfClearDeviceNImage(pdf);
pdfConvertPageToDeviceNImage
pdfGetDeviceNToRGBBitmap
pdfRemoveDeviceNChannel
pdfClearDeviceNImage