DynaPDF Manual - Page 703

Previous Page 702   Index   Next Page 704

Function Reference
Page 703 of 839
SetCompressionFilter
Syntax:
LBOOL pdfSetCompressionFilter(
const PPDF* IPDF,
// Instance pointer
TCompressionFilter Filter) // see below
typedef enum
{
cfFlate
= 0,
cfJPEG
= 1,
cfCCITT3
= 2, // PDF or TIFF output
cfCCITT4
= 3, // PDF or TIFF output
cfLZW
= 4, // TIFF or GIF output
cfReserved = 5, // Reserved for future extensions.
cfFlateBW
= 6, // TIFF, PNG, or BMP output
cfJP2K
= 7, // PDF or JPEG2000 output
cfJBIG2
= 8, // PDF output only
// Special flags for AddRasImage(), RenderPageToImage(), and RenderPDFFile().
cfDitherFloydSteinberg = 0x00001000, // Floyd Steinberg Dithering.
cfConvGrayToOtsu
= 0x00002000, // Optimal filter for an OCR scan.
// Special flags for Optimize()
cfPresLosslessFilter = 0x00020000, // Preserve loss-less compression filters. Use the specified
// filter otherwise.
cfPresLossyFilter
= 0x00040000
// Preserve lossy compression filters. Use the specified
// filter otherwise.
}TCompressionFilter;
The function sets the compression filter that should be used to compress images. The filters are
described in detail at InsertImageEx().
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
SetCompressionLevel
Syntax:
LBOOL pdfSetCompressionLevel(
const PPDF* IPDF,
// Instance pointer
TCompressionLevel CompressLevel) // see below
typedef enum
{
clNone
= 0, // No compression (ignored for images)
clDefault = 1, // Normal compression ratio
clFastest = 2, // Less compression ratio but faster
clMax
= 3
// Maximum compression ratio but slower
}TCompressionLevel;
The function sets the current compression level. If the compression level is clNone, content streams
will be left uncompressed. This value is useful if a content stream must be debugged, the value will
be ignored for image streams. The compression level is also used by certain image compression
filters, see InsertImage() for further information.
Return values:
 

Previous topic: SetColors, SetColorSpace

Next topic: SetContent, SetDateTimeFormat