Xojo Conferences
MBSOct2019CologneDE

DynaPDF Manual - Page 533

Previous Page 532   Index   Next Page 534

Function Reference
Page 533 of 770
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.
/* ---------------------------- Notice: ----------------------------------------------
* Special color spaces like Separation, DeviceN, and NChannel are ignored unless the flag
ofConvertAllColors is set too.
*/
ofConvertToGray
= 0x00020000, // Convert images, text, and vector graphics to DeviceGray.
ofConvertToRGB
= 0x00040000, // Convert images, text, and vector graphics to DeviceRGB.
ofConvertToCMYK
= 0x00080000
// Convert images, text, and vector graphics to DeviceCMYK.
ocReplaceJP2KWithJPEG
= 0x00100000
// Meaningful only, if the flag ofConvertToGray,
// ofConvertToRGB, or ofConvertToCMYK is set. If set, JPEG
// 2000 compressed images (which are converted to another
// color space) will be compressed with JPEG instead of JPEG
// 2000. JPEG 2000 compression is very slow and requires
// much memory. JPEG compression is around 10 times faster
// and produces almost identical results.
}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.
 

Previous topic: OpenTag

Next topic: Usage, Re-compressing 1 bit images with JBIG2