DynaPDF Manual - Page 429

Previous Page 428   Index   Next Page 430

Function Reference
Page 429 of 839
GetImageHeight
Syntax:
SI32 pdfGetImageHeight(
const PPDF* IPDF, // Instance pointer
UI32 AHandle)
// Image handle
The function returns the height of an image in pixel. This value is may be smaller than the height of
the original image, if it was downscaled by DynaPDF.
Return values:
If the function succeeds the return value is the height of the image in pixel. If the function fails the
return value is a negative error code.
GetImageObj
Syntax:
LBOOL pdfGetImageObj(
const PPDF* IPDF,
// Instance pointer
UI32 Handle,
// Image handle
TParseFlags Flags, // See below
TPDFImage* Image)
// Structure to be filled with data
typedef UI32 TParseFlags;
#define pfNone
0x00000000 // Default
#define pfDecomprAllImages 0x00000002 // Decompress all image types
#define pfNoJPXDecode
0x00000004 // Do not decompress JPEG2000 images
#define pfDitherImagesToBW 0x00000008 // Floyd-Steinberg dithering.
#define pfConvImagesToGray 0x00000010 // Convert the image to DeviceGray
#define pfConvImagesToRGB
0x00000020 // Convert the image to DeviceRGB
#define pfConvImagesToCMYK 0x00000040 // Convert the image to DeviceCMYK
#define pfImageInfoOnly
0x00000080 // Return only the image properties
The function retrieves the properties of an image as well as the decompressed image buffer if
needed. By default all images are returned decompressed, with exception of image types which are
already stored in a valid file format like JPEG and JPEG 2000 images.
If all image types should be decompressed set the flag pfDecompressAllImages.
This function allocates memory that should be released with FreeImageObj() when finish.
Image handles are simple array indexes. The number of image objects can be determined with
GetImageObjCount(). Note that this array does not include inline images which are stored in
content streams. Such images can only be accessed with ParseContent().
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
 

Previous topic: GetIconColor, GetImageBuffer, GetImageCount, GetImageCountEx

Next topic: GetImageObjCount, GetImageObjEx, GetImageWidth