PDFOptimizer Class Documentation
class PDFOptimizerNamespace:datalogics_interface
Detailed Description
Implementation of the PDF Optimizer function.
Use the PDFOptimizer object to accumulate options for the Optimization, and to Optimize documents.
Constructor & Destructor Documentation
PDFOptimizer
PDFOptimizer()Construct a CPDFOptimizer, with default Options.
PDFOptimizer
PDFOptimizer(PDFOptimizer && )Parameters
~PDFOptimizer
~PDFOptimizer()Member Function Documentation
get_compression_quality
OptimizerCompressQuality get_compression_quality(OptimizerImageType type)Parameters
type: OptimizerImageTypeThe image color type (Color, Gray, or BW) to query.
Returns:
OptimizerCompressQualityThe compression quality level for the specified color model.
Get the value of the Compression Quality for a given color model.
get_major_version
int get_major_version()Returns:
intThe major PDF version number, or 0 if the Optimizer will decide.
Get the value of the Major Version of the optimized document.
NOTE: A value of 0 indicates the Optimizer will decide what version it should be.
get_max_resolution
int get_max_resolution(OptimizerImageType type)Parameters
type: OptimizerImageTypeThe image color type (Color, Gray, or BW) to query.
Returns:
intThe maximum resolution in DPI above which images will be downsampled.
Get the value of the Max DPI for a given color model.
get_minor_version
int get_minor_version()Returns:
intThe minor PDF version number.
Get the value of the Minor Version of the optimized document.
get_object_compression
OptimizerObjectCompression get_object_compression()Returns:
OptimizerObjectCompressionThe current object compression type setting.
Get the value of the Object Compression of the optimized document.
get_option
bool get_option(OptimizerOption option)Parameters
option: OptimizerOptionThe optimization option to query.
Returns:
booltrue if the option is enabled, false if it is disabled.
Get the value of a single Optimizer Option.
get_recompression_type
OptimizerCompressionType get_recompression_type(OptimizerImageType type)Parameters
type: OptimizerImageTypeThe image color type (Color, Gray, or BW) to query.
Returns:
OptimizerCompressionTypeThe compression type that will be applied to images of the specified color model.
Get the value of the Recompression Type for a given color model.
get_resample_to_resolution
int get_resample_to_resolution(OptimizerImageType type)Parameters
type: OptimizerImageTypeThe image color type (Color, Gray, or BW) to query.
Returns:
intThe target resolution in DPI to which images will be downsampled.
Get the value of the Resample To DPI for a given color model.
operator=
PDFOptimizer & operator=(PDFOptimizer && )Parameters
Returns:
PDFOptimizer &optimize
void optimize(Document & document, const std::string & output_path)Parameters
document: Document &The document to optimize.
output_path: const std::string &The file system path where the optimized document will be saved.
Returns:
voidOptimize a document and save to a new file path. Perform the Optimization of a single document, saving the result in a new file.
set_compression_quality
void set_compression_quality(OptimizerImageType type, OptimizerCompressQuality value)Parameters
type: OptimizerImageTypeThe image color type (Color, Gray, or BW) to set.
value: OptimizerCompressQualityThe compression quality level to apply.
Returns:
voidSet the value for the Compression Quality for a given color model. Any image that recompressed, regardless of the reason, will use this Quality for the Quality value of the specific compression type.
set_major_version
void set_major_version(int major)Parameters
major: intThe major PDF version number.
Returns:
voidSet the value for the Major Version for the optimized document.
set_max_resolution
void set_max_resolution(OptimizerImageType type, int value)Parameters
type: OptimizerImageTypeThe image color type (Color, Gray, or BW) to set.
value: intThe maximum resolution in DPI.
Returns:
voidSet the value for the Max DPI for a given color model. Any image above this resolution will be down sampled, if the Downsampling option is true for this color model.
set_minor_version
void set_minor_version(int minor)Parameters
minor: intThe minor PDF version number.
Returns:
voidSet the value for the Minor Version for the optimized document.
set_object_compression
void set_object_compression(OptimizerObjectCompression type)Parameters
type: OptimizerObjectCompressionThe desired object compression type.
Returns:
voidSet the value for the Object Compression for the optimized document.
set_option
void set_option(OptimizerOption option, bool value)Parameters
option: OptimizerOptionThe optimization option to set.
value: booltrue to enable the option, false to disable it.
Returns:
voidSet the value of a single Optimizer option.
set_recompression_type
void set_recompression_type(OptimizerImageType type, OptimizerCompressionType value)Parameters
type: OptimizerImageTypeThe image color type (Color, Gray, or BW) to set.
value: OptimizerCompressionTypeThe compression type to apply.
Returns:
voidSet the value for the recompression Type for a given color model. Any image that is downsampled will be compressed using this method, if the Downsampling option is true for this color model. Any image that is not downsampled, will be converted to this compression type, if it is not already compressed in this type, and the Recompression option for this color model is true.
set_resample_to_resolution
void set_resample_to_resolution(OptimizerImageType type, int value)Parameters
type: OptimizerImageTypeThe image color type (Color, Gray, or BW) to set.
value: intThe target resolution in DPI.
Returns:
voidSet the value for the Resample To DPI for a given color model. Any image will be downsampled to this resolution, if the Downsampling option is true for this color model.