DynaPDF Manual - Page 587

Previous Page 586   Index   Next Page 588

Function Reference
Page 587 of 839
typedef enum
{
of3Default
= 0x00000000
// Nothing to do
}TOptimizeFlags3;
typedef enum
{
of4Default
= 0x00000000
// Nothing to do
}TOptimizeFlags4;
struct TOptimizeParams
{
UI32
StructSize;
// Must be set to sizeof(TOptimizeParams).
UI32
Min1BitRes;
// Minimum resolution before scaling.
UI32
MinGrayRes;
// Minimum resolution before scaling.
UI32
MinColorRes;
// Minimum resolution before scaling.
UI32
Res1BitImages;
// 1 bit black & white images.
UI32
ResGrayImages;
// Gray images.
UI32
ResColorImages; // Multi-channel images.
TCompressionFilter Filter1Bit;
// Filter for black & white images.
TCompressionFilter FilterGray;
// Filter for gray images.
TCompressionFilter FilterColor;
// Filter for multi-channel images.
SI32
JPEGQuality;
// JPEG quality.
SI32
JP2KQuality;
// JPEG 2000 quality.
float
MinLineWidth;
// Zero means no hair line removal.
const UI32*
ExcludeCS;
// Array of color space handles which should be excluded from
// color conversion.
SI32
ExcludeCSCount; // Number of handles in the array. This can be a negative
// value to reverse the meaning. That means convert these
// color spaces and ignore all others.
TOptimizeFlags2
Flags2;
// Additional flags
TOptimizeFlags3
Flags3;
// Additional flags
TOptimizeFlags4
Flags4;
// Additional flags
};
The function rebuilds the content streams of all pages, templates, patterns, annotations, and form
fields. Useless operators as well as errors in content streams will be fully removed. The resulting
content streams are error free and usually smaller. How much the optimization takes effect depends
on the quality of the original content streams.
Besides content optimization it is also possible to flatten layers, scale or just re-compress images,
delete watermarks, or to correct hairlines.
The parameter Flags is a bit mask. Multiple flags can be combined with a binary or operator, e.g.
ofInMemory | ofScaleImage.
The flag ofScaleImages will be ignored if the parameter Parms is set to NULL.
Optimize() does not rebuild font subsets like CheckConformance(). The function is part of DynaPDF
Professional.
Usage
It is assumed that this function is called right before closing the PDF file. It is not allowed to call the
function twice for the same PDF file in memory.
 

Previous topic: Optimize

Next topic: Re-compressing 1 bit images with JBIG2, Text to outline conversion, Color conversion