convertRegionToPicture

Convert a rectangular region to a Picture object.
convertRegionToPicture([in] int page, [in] int regionX, [in] int regionY, [in] int regionW, [in] int regionH, [in] double dpi, [in] int color, [out, retval] IUnknown **pic)
This function converts a rectangular region of a PDF page to a Picture object (OLE IPicture interface).

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 are read-only properties on the COM component, so you'll need to use 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 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.

VB:
' convert the top part of page 5 to a 72 dpi color Picture object picBox.Picture = pdf.convertRegionToPicture(5, 0, 0, 1000, 500, 72, pdf.imageRGB)
writePageBitmap
writePageBitmap2
convertPageToPicture
convertPageToPicture2
convertRegionToPicture2