Xojo Conferences

DynaPDF Manual - Page 134

Previous Page 133   Index   Next Page 135

Function Reference
Page 134 of 766
However, most OCR engines have problems to identify glyphs in dithered images. For this purpose,
the Otsu filter is the best choice. This filter produces true black & white output. It does not try to
simulate gray shades by dithering areas of the image. If you want to apply an OCR scan then filter is
the one you should use.
There are two ways to apply the Floay Steinberg dithering algorithm: either combine the flag
cfDitherFloydSteinberg with the compression filter you want to use:
TCompressionFilter(cfFlate | cfDitherFloydSteinberg)
or use one of the filters cfCCITT3/4, cfLZWBW or cfFlateBW. These constants were already defined
in DynaPDF 3.0. However, in future we use separate flags for such things because it is more flexible.
The Otsu filter can be activated in the very same way:
TCompressionFilter(cfFlate | cfConvGrayToOtsu)
Compression filters
The compression filter is only considered for TIFF output because all other image formats support
only one specific filter. The compression filter must be compatible to the pixel format. For example,
CCITTFax compression is compatible to 1 bit images, it is not supported for gray or color images.
Note also that Flate is no standard TIFF compression filter. Many TIFF viewers cannot display Flate
compressed TIFF images. LZW is the alternate filter. LZW compression is faster than flate and
achieves almost the same compression ratios.
The function is able to create up to 4 GB large TIFF image files. Depending on the used compression
filter and compression ratio this is mostly enough to create TIFF images with up to 8000 RGB pages
in a resolution of 300 DPI. However, the maximum number of pages depends on the resolution,
compression ratio and pixel format.
The JPEG Quality and compression level can be adjusted with SetJPEGQuality() and
SetCompressionLevel() before calling the function.
Return values:
When the function succeeds the return value is 1. When the function fails the return value is 0.
AddRenderingIntent (obsolete)
SI32 pdfAddRenderingIntent(
const PPDF* IPDF,
// Instance pointer
const char* ICCFile) // File path of the ICC profile
This function was incorrectly named. The correct name is AddOutputIntent(). Please use the
correctly named version instead.

Previous topic: 1 bit image output

Next topic: AddValToChoiceField