DynaPDF Manual - Page 539

Previous Page 538   Index   Next Page 540

Function Reference
Page 539 of 839
JPG -> JPEG images should be inserted in pass-though mode if possible. See the description
of the compression filter below.
JP2, JPC, or JPX -> These formats are JPEG 2000 compressed images.
PBM, PGM, PNM, PPM -> ASCII and Binary encoded images.
PNG -> Flate compressed images. Since Flate is the native compression filter of PNG images,
this filter should be set when inserting the image.
PSD -> Only the preview image will be processed.
TIFF
How to get the image format?
The most important image parameters such as width, height, bits per pixel and the default
compression filter can be retrieved with the function ReadImageFormat() or ReadImageFormatEx().
Color spaces
The handling of image color space is described in detail at Color Spaces and Images.
How to change the color depth?
DynaPDF can reduce the color depth of true color images to 256 color images. The color depth will
be changed if the default color depth was set to 8 bit per pixel and if the used compression filter is
Flate. The default color depth can be changed with the function SetDefBitsPerPixel().
Duplicate check
The function performs by default a duplicate check so that the same image can be inserted multiple
times without increasing the resulting PDF file size. For file based images the function compares the
file name and the output parameters like the scaled width and height, transparency settings and so
on. For memory based images the entire image buffer is taken into account. The required processing
time for the duplicate check is therefore considerable higher for memory based images.
However, the duplicate check for file based images can lead to wrong results, e.g. if the application
creates temporary images with the same file name. In such cases it is possible to disable the
duplicate check with the flag gfNoImageDuplCheck. The flag can be set with SetGStateFlags().
Compression Filters
At time of publication DynaPDF supports Flate, CCITT Fax G3, CCITT Fax G4, JBIG2, JPEG, and
JPEG 2000 compression. The compression filter can be individually set with SetCompressionFilter().
Flate Encode
Flate encode (also called zip compression) is a loss-less compression filter. It can be used with all
supported color spaces. It produces good compression rates for images with large uniform surfaces.
 

Previous topic: InsertImage (obsolete), InsertImageEx, Supported image formats

Next topic: CCITT Fax G3/4, JBIG2, JPEG Encode, Real pass-through mode