pdfWriteRegionBitmap
The rectangular region is specified by the x,y coordinates of its upper-left corner and its width and height - in bitmap coordinates, not PDF coordinates. That is, if the whole-page bitmap would have been 1000 pixels wide and 2000 pixels high, and you request a region with (x,y) = (0,0) and (w,h) = (1000,500), the resulting bitmap will be the top fourth of the page.
The arguments are:
page
= page numberregionX
,regionY
= upper-left corner of regionregionW
,regionH
= width and height of regiondpi
= resolution (dots per inch)color
= color setting - one of:pdfImageMono
: 1-bit monochromepdfImageGray
: 8-bit grayscalepdfImageRGB
: 8-bit RGBpdfImageCMYK
: 8-bit CMYKpdfImageDevNToCMYK
: 8-bit CMYK, rasterized in DeviceN and then converted to CMYKpdfImageDevNToRGB
: 8-bit RGB, rasterized in DeviceN and then converted to RGBpdfImageGrayToMono
: 1-bit monochrome, rasterized in 8-bit grayscale and then converted to 1-bit
format
= image file format - one of:pdfImageFileBMP
: Windows BMP format
(available for mono, gray, RGB, DevNToRGB, GrayToMono)pdfImageFileTIFF
: uncompressed TIFF format
(available for mono, gray, RGB, CMYK, DevNToCMYK, DevNToRGB, GrayToMono)pdfImageFileJPEG
: JPEG format
(available for gray, RGB, CMYK, DevNToCMYK, DevNToRGB)pdfImageFilePNG
: PNG format
(available for mono, gray, RGB, DevNToRGB, GrayToMono)pdfImageFilePNM
: PBM (monochrome), PGM (grayscale), or PPM (RGB) file - these formats are more commonly used on Unix (but are available in all versions of XpdfRasterizer)
(available for mono, gray, RGB, DevNToRGB, GrayToMono)
fileName
= image file name
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.