Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 482

Previous Page 481   Index   Next Page 483

Function Reference
Page 482 of 750
physHeight = h / (resX / resY);
= w / (resY / resX);
physHeight = h;
physHeight = h;
= w;
Note that the above calculation uses integer arithmetic. Note also that you don't need to consider the
physical size when inserting such an image. The physical size should be used to determine the paper
format when converting scanned faxes to PDF since the logical format produces often no exact match
with available paper formats when calculated with the given resolution information.
Bitmap images
Bitmaps support alpha transparency but most image viewers discard the alpha channel. This can
lead to diffent results since DynaPDF considers the alpha channel in 32 bit bitmaps by default.
Since many 32 bit bitmaps contain an invalid alpha channel that is zero for all pixels, it is possible to
fully discard the alpha channel as most image viewers would do. This can be achieved by setting the
flag gfNoBitmapAlpha with SetGStateFlags().
GIF images
GIF images are LZW compressed images which are widely used in the internet. LZW is a loss-less
compression filter. Non-transparent GIF images are recompressed with the current compression
filter when inserting the image. The optimal compression filter for GIF images is Flate, and therefore,
the compression filter should be set to Flate before inserting such an image (see
Transparent GIF images are handled differently. GIF images use color key masking to achieve the
transparency effect. This kind of masking depends on exact color values and therefore, it is not
possible to compress such images with JPEG or JPEG 2000 compression without invalidating the
transparency information. To achieve correct results DynaPDF changes the compression filter for
transparent GIF images automatically to Flate and the image will not be downscaled independent of
the used settings.
Note also that transparent GIF images will be inserted transparent independent of the current
transparency settings. DynaPDF considers also the image resolution information if the image uses
different values for the x- and y-axis.

Previous topic: 1 Bit TIFF images

Next topic: Transparent images (Color Key Masking)