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

DynaPDF Manual - Page 481

Previous Page 480   Index   Next Page 482

Function Reference
Page 481 of 750
obsolete by Adobe. Because it is not clear whether this filter will be supported in future versions of
Adobe's Acrobat, it will not be added to DynaPDF.
What about JBIG2 compression?
JBIG2 is a compression method that was designed to compress 1 bit images such as sampled faxes. It
supports loss-less and lossy compression. Because JBIG2 supports a global symbol table that can be
shared among pages (or images) very high compression rates can be achieved with multi-page
documents. The JBIG2 compression filter is not yet implemented in DynaPDF but it is planned to
add it as soon as possible.
TIFF images
The TIFF image format is the most complex format of all available image formats. DynaPDF
supports a full featured implementation of the TIFF format incl. most currently available
compression methods and color spaces. TIFF images can be organized in scanlines, tiles or stripes, all
three formats are fully supported by DynaPDF.
If the image is a multi-page image, a specific image can be selected with the parameter Index. The
first image has the index 1. The number of available images inside a multi-page image can be
determined with the function GetImageCount().
TIFF images can be defined in device dependent and device independent color spaces, such as Lab,
CalGray, CalRGB, or ICC based color spaces. If the original color space should be preserved if
possible, set the flag gfUseImageColorSpace with SetGStateFlags(). See also Color Spaces and
1 Bit TIFF images
1 bit TIFF images use sometimes different resolutions for the x- and y-axis. DynaPDF considers the
resolution information and scales the image according to the resolution information that is stored in
the image file. Note that the resolution information is only considered for 1 bit images. No
adjustment will be applied for higher bit depths since most image viewers do the same.
It is important to know that ReadImageFormat() or ReadImageFormat2() return the logical size of 1
bit TIFF images. That means, the resolution information was already taken into account. The physical
size of a 1 bit TIFF image can be calculated as follows:
SI32 bits, useZip;
UI32 resX = 0, resY = 0, physHeight, physWidth, w, h;
pdfReadImageFormat2(pdf, "test.tif", 1, w, h, bits, useZip);
pdfReadImageResolution(pdf, "test.tif", 1, resX, resY);
if (resX != resY && resX > 0 && resY > 0)
if (resX > resY)
= w;

Previous topic: Why does DynaPDF not support LZW compression?

Next topic: GIF images