pdfSaveImageAsBMP

Save an image as a BMP file.
int pdfSaveImageAsBMP(PDFHandle pdf, int idx, char *bmpFileName)
This function saves the idxth image on the page specified in the last call to pdfGetImages as a BMP (Windows bitmap) file. It returns 1 if successful, 0 if there was an error.

This function will create a 1-bit or 24-bit BMP file, depending on the image.

Typically, the PBM/PGM/PPM formats are used on Unix systems and the BMP format on Windows systems, but all formats are available in all versions of the XpdfImageExtract library.

C:
char *csName; int nImgs, i, mask, colorSpace, w, h; nImgs = pdfGetNumImages(pdf); for (i = 0; i < nImgs; ++i) { /* Save the image as a BMP file */ pdfSaveImageAsBMP(pdf, i, "image.bmp"); }
pdfGetImages
pdfGetNumImages
pdfSaveImageAsPBM
pdfSaveImageAsPGM
pdfSaveImageAsPPM