Xojo Conferences
XDCMay2019MiamiUSA
MBSOct2019CologneDE

DynaPDF Manual - Page 530

Previous Page 529   Index   Next Page 531

Function Reference
Page 530 of 766
Optimize
Syntax:
LBOOL pdfOptimize(
const PPDF* IPDF,
// Instance pointer
TOptimizeFlags Flags,
// See below
struct TOptimizeParams* Parms) // Can be NULL, see desciption below
typedef enum
{
ofDefault
= 0x00000000, // Just rebuild the content streams.
ofInMemory
= 0x00000001, // Optimize the file fully in memory.
ofConvertAllColors
= 0x00000002, // If set, Separation, DeviceN, and NChannel color spaces
// will be converted to the device space.
ofIgnoreICCBased
= 0x00000004, // If set, ICCBased color spaces will be left unchanged.
ofScaleImages
= 0x00000008, // Scale images.
ofSkipMaskedImages
= 0x00000010, // Meaningful only if ofScaleImages is set. If set, don't
// scale images with a color mask.
ofNewLinkNames
= 0x00000020, // If set, rename all object links to short names.
ofDeleteInvPaths
= 0x00000040, // Delete invisible paths. An invisible path is a path that
// was finished with the no-op operator "n".
ofFlattenLayers
= 0x00000080, // Flatten layers if any.
ofDeletePrivateData
= 0x00000100, // Delete private data from pages, templates, and images.
ofDeleteThumbnails
= 0x00000200, // No need to embed thumbnails (can be created on demand).
ofDeleteAlternateImages = 0x00000400, // If set, alternate images will be deleted if any.
ofNoImageSizeCheck
= 0x00000800, // Meaningful only if ofScaleImages is set. If set, do not
// check whether the scaled image is smaller.
ofIgnoreZeroLineWidth
= 0x00001000, // Meaningful only if the parameter MinLineWidth of the
// TOptimizeParams structure is greater zero.
// If set, ignore line width operators with a value of zero
// (zero means one device unit).
ofAdjZeroLineWidthOnly
= 0x00002000, // Meaningful only if the parameter MinLineWidth of the
// TOptimizeParams structure is greater zero. If set, change
// the line width of real hairlines only (a hairline is a
// one pixel width line -> LineWidth == 0).
ofCompressWithJBIG2
= 0x00004000, // If set, 1 bit images are compressed with JBIG2 if not
// already compressed with this filter.
ofNoFilterCheck
= 0x00008000, // Meaningful only, if the flag ofCompressWithJBIG2 is set.
// If set, re-compress all 1 bit images, also if already
// compressed with JBIG2.
ofConvertGrayTo1Bit
= 0x00010000 // Useful for scanned faxes since many scanners create gray
// images for black & white input.
}TOptimizeFlags;
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.
};
 

Previous topic: OpenTag

Next topic: Converting gray images to 1 bit (black & white)