getImageInfo
Get information about an image.
getImageInfo([in] int idx, [out] int *mask, [out] int *colorSpace,
[out] int *width, [out] int *height)
This function retrieves information about
the
idx
th image on the page specified in the
last call to getImages
.
The following information is returned:
mask
is a boolean flag, set to 1 for image masks and 0 for images - in PDF files, an "image mask" is a monochrome image which is drawn with the current fill color; the image mask itself does not include any color information (just opaque and transparent pixels).colorSpace
is an integer indicating the color space type used by the image - seenumColorSpaces
andgetColorSpaceName
for information on color space types. Image masks have no color information, so the colorSpace value is undefined and should be ignored ifmask
is 1.width
andheight
define the size of the image, in pixels - this is the size of the raw image data found in the PDF file; the image may be scaled up or down (and cropped, rotated, sheared, etc.) when it is displayed on the page.
VB:
Dim mask As Long, colorSpace As Long, w As Long, h As Long
' scan the images on page 1
pdf.getImages(1)
nImgs = pdf.numImages
For i = 0 To nImgs-1
pdf.getImageInfo(i, mask, colorSpace, w, h)
....
Next i