Write a page to an image file.
int pdfWritePageBitmap2(PDFHandle pdf, int page, double hDPI, double vDPI, int color, int format, char *fileName)
This function converts a PDF page to an image file on disk. It is identical to pdfWritePageBitmap, except that it allows the horizontal and vertical resolutions to be controlled independently.

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 144x72 dpi color TIFF file */ pdfWritePageBitmap2(pdf, 5, 144, 72, pdfImageRGB, pdfImageFileTIFF, "test1.tiff");