writeRegionBitmap2

Write a rectangular region to an image file.
writeRegionBitmap2([in] int page, [in] int regionX, [in] int regionY, [in] int regionW, [in] int regionH, [in] double hDPI, [in] double vDPI, [in] int color, [in] int format, [in] BSTR fileName)
This function converts a rectangular region of a PDF page to an image file on disk. This can be useful if the page is too large to fit in memory at the desired resolution, or if only part of the page is needed for some purpose. It is identical to writeRegionBitmap, except that it allows the horizontal and vertical resolutions to be controlled independently.

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:

Note that the color settings and image file formats are read-only properties on the COM component, so you'll need to use pdf.imageMono, pdf.imageFileBMP, etc.

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 imageDevNToRGB mode is similar to imageDevNToCMYK, but converts to RGB output.

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.

CMYK output is only available in TIFF format.

VB:
' convert the top part of page 5 to a 144x72 dpi color TIFF file pdf.writeRegionBitmap2(5, 0, 0, 1000, 500, 144, 72, pdf.imageRGB, pdf.imageFileTIFF, "test1.tiff")