Write a page to an image file.
int pdfWritePageBitmap(PDFHandle pdf, int page, double dpi, int color, int format, char *fileName)
This function converts a PDF page to an image file on disk.

The arguments are:

The pdfImageDevNToCMYK mode produces CMYK output like pdfImageCMYK, but does the rasterization in DeviceN (CMYK + spot colors) so overprint previews will be more accurate.

The pdfImageDevNToRGB mode is similar to pdfImageDevNToCMYK, but converts to RGB output.

The pdfImageGrayToMono mode does the rasterization in 8-bit grayscale and converts to 1-bit monochrome at the end. This is useful for files that use transparency – because 1-bit monochrome mode doesn't support transparency.

CMYK output is only available in TIFF format.

/* convert page 5 to a 72 dpi color TIFF file */ pdfWritePageBitmap(pdf, 5, 72, pdfImageRGB, pdfImageFileTIFF, "test1.tiff");