convertPageToBitmap2
convertPageToPicture2
, except that it returns a raw bitmap instead
of an OLE IPicture object.
The arguments are:
page
= page numberdpi
= resolution (dots per inch)color
= color setting - one of:imageMono
: 1-bit monochromeimageGray
: 8-bit grayscaleimageRGB
: 8-bit RGBimageCMYK
: 8-bit CMYKimageDevNToRGB
: 8-bit RGB, rasterized in DeviceN and then converted to RGBimageDevNToCMYK
: 8-bit CMYK, rasterized in DeviceN and then converted to CMYKimageGrayToMono
: 1-bit monochrome, rasterized in 8-bit grayscale and then converted to 1-bit
width
= bitmap width (output argument)height
= bitmap height (output argument)stride
= bitmap stride, i.e., bytes per row (output argument)
pdf.imageMono
, etc.
The imageDevNToRGB
mode produces RGB output like imageRGB
, but
does the rasterization in DeviceN (CMYK + spot colors) so overprint
previews will be more accurate.
The imageDevNToCMYK
mode produces CMYK output like imageCMYK
, but
does the rasterization in DeviceN (CMYK + spot colors) so overprint
previews will be more accurate.
The imageGrayToMono
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.
NB: The returned value is an HGLOBAL
(i.e.,
XpdfRasterizer allocates it with GlobalAlloc
), and the
caller is responsible for calling GlobalFree
(or Marshal.FreeHGBlobal
) to free it.