DynaPDF Manual - Page 550

Previous Page 549   Index   Next Page 551

Function Reference
Page 550 of 787
Re-compressing 1 bit images with JBIG2
If the flag ofCompressWithJBIG2 is set, 1 bit images will be re-compressed with JBIG2 (if the image
was not already compressed with this filter). This can drastically reduce the file size since JBIG2
compression achieves much higher compression rates than any other 1 bit image filter that PDF
supports. The JBIG2 compression filter in DynaPDF is lossless, that means the original image quality
will be preserved.
Text to outline conversion
The function converts text to outlines if the flag ofConvTextToOutlines is set. The flattening algorithm
loads exactly the same fonts as the rendering engine would load and it scales fonts in the very same
way. What you see is what you get.
Outlines are scaled to a master size of 1000 units to achieve high quality output. It stores hinted
outlines with preserved curves. The resulting PDF files are much smaller in comparison to fully
flattened outlines and offer higher quality since curves stay smooth regardless of the zoom factor.
It is also possible to restrict the conversion to non-embedded fonts with the flag
ofConvNonEmbFontsOnly since these fonts are usually the problematic ones when printing on
Postscript devices.
Annotations and form fields are not affected by the conversion. In order to consider these objects too
it is possible to flatten all annotations and form fields before calling Optimize(). See FlattenAnnots()
for further information.
Color conversion
The function converts images, text, and vector graphics to a device color space if one of the flags
ofConvertToGray, ofConvertToRGB, or ofConvertToCMYK is set. At time of publication color
conversion is done without color management. However, support for color management will be
added as soon as possible.
The function compresses converted images by default with the same filter that the original image
used. The JPEG quality of JPEG compressed images is taken from the global property (see
SetJPEGQuality()) or from the TOptimizeParams structure if set.
The quality of JPEG 2000 images is calculated from the original image. Since JPEG 2000 is a very
slow filter and requires very much memory, it is possible to replace the filter with JPEG instead. Set
the flag ocReplaceJP2KWithJPEG in this case.
Converting gray images to 1 bit (black & white)
Gray images will be converted to 1 bit b&w if the flag ofConvertGrayTo1Bit is set. The flag is
considered only if the flag ofCompressWithJBIG2 is set or if the parameter Parms and the flag
ofScaleImages is set. The conversion of gray images to b&w is mainly useful for scanned faxes since
many scanners create gray images for b&w input.

Previous topic: Usage

Next topic: Image scaling, Spot color spaces, Image size check, Masked images (color key masking), Hairline correction

Start Chat