DynaPDF Manual - Page 591

Previous Page 590   Index   Next Page 592

Function Reference
Page 591 of 839
Image size check
The function checks whether the new image is smaller as the original one (except if a color
conversion flag is set). If no size reduction can be achieved then the image is stored unchanged. The
size check can be disabled with the flag ofNoImageSizeCheck.
Images which were inserted with DynaPDF functions like InsertImage() will be ignored.
Masked images (color key masking)
Color key masking is a technique to make parts of an image transparent. This type of masking
depends on exact color values because a specific color is used to mask the transparent areas. If such
an image will be scaled, it is possible that the color of certain pixels will be changed due to color
interpolation and this can lead to visible differences which are maybe not acceptable.
To avoid issues with masked images it is recommended to set the flag ofSkipMaskedImages.
Hairline correction
If the member MinLineWidth of the structure TOptimizeParams is greater zero the line width of
stroked paths will be set to MinLineWidth if the scaled value was smaller. The function considers all
transformations of the coordinate system.
The line width is measured in PDF units. One PDF unit represents 1/72 inch.
The minimum line width should be smaller or equal 1.0. The maximum value is 10.0 units.
Depending on the used flags it is possible to correct real hairlines only (zero width lines), all lines
which are thinner than MinLineWidth, or all lines with exception of real hairlines (line width = 0).
Possible issues
Hairline correction does not always produce the expected result, e.g. lines which look like a stroked
path are in fact filled rectangles. It is also possible that a surrounding clipping path prevents a
visible change of the line width.
Special flags
The flag ofDeletePrivateData can be set to delete private data objects from pages, templates, and
images. Private data objects are created by several applications. For example, Adobe's Photoshop or
InDesign write the original images or PDF pages into private data structures (depending on the
settings in these applications).
A normal PDF viewer does not understand this data and ignores it. Because such objects are often
very large it is recommended to delete useless private data.
Optimize can do a lot but not anything. For example, the function does not perform a duplicate
check for images, templates, and so on. Such a duplicate check is available when importing a PDF

Previous topic: Special compression filter flags:, Image size check, Converting gray images to 1 bit (black & white), Image scaling, Spot color spaces

Next topic: Error handling