DynaPDF Manual - Page 538

Previous Page 537   Index   Next Page 539

Function Reference
Page 538 of 839
InsertImage (obsolete)
Syntax:
SI32 pdfInsertImage(
const PPDF* IPDF,
// Instance pointer
double PosX,
// X-Coordinate of destination rectangle
double PosY,
// Y-Coordinate of destination rectangle
double ScaleWidth,
// Scaled width of destination rectangle
double ScaleHeight, // Scaled height of destination rectangle
const char* AFile)
// File path
This function is marked as obsolete, please use the function InsertImageEx() if possible.
InsertImageEx
Syntax:
SI32 pdfInsertImageEx(
const PPDF* IPDF,
// Instance pointer
double PosX,
// X-Coordinate of destination rectangle
double PosY,
// Y-Coordinate of destination rectangle
double ScaleWidth,
// Scaled width of destination rectangle
double ScaleHeight, // Scaled height of destination rectangle
const char* AFile,
// File path
UI32 Index)
// Image index
The function inserts an image from a file. The parameter Index specifies the image index of a multi-
page image. The first image index is denoted by 1. If the image file is not a multi-page image, the
parameter Index will be ignored. To determine the number of images stored in an image file call the
function GetImageCount().
The image will be compressed with the compression filter that was set with SetCompressionFilter().
The default filter is Flate, which is a lossless compression filter. JPEG images should be inserted in
pass-though mode if possible, see the description of the JPEG filter below.
Supported image formats
The function does not depend on a correct file extension. It parses the image header to determine the
image format. The following image formats are supported:
BMP -> Device independent bitmaps with and without a valid file header. Embedded PNG
and JPEG images are supported. Which filter should be used for bitmaps depends on type pf
the image. Bitmaps are usually uncompressed or run-length encoded. Since Flate is a loss-
less compression filter, this filter can be used as a default if the filter cannot be changed in
the application.
GIF -> The best alternate compression filter for GIF images is Flate encoding. GIF images are
treated as single page image. It is not possible to access a specific frame of a GIF animation.
 

Previous topic: InsertBookmarkEx

Next topic: How to get the image format?, Color spaces, How to change the color depth?, Duplicate check, Compression Filters, Flate Encode