PDFOptimizer Class Documentation
classPDFOptimizerNamespace:datalogics_interface
Detailed Description
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
OptimizerCompressQualityget_compression_quality(OptimizerImageTypetype)Parameters
type: OptimizerImageTypeThe image color type (Color, Gray, or BW) to query.
Returns:
The compression quality level for the specified color model.Get the value of the Compression Quality for a given color model.
get_major_version
intget_major_version()Returns:
The 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
intget_max_resolution(OptimizerImageTypetype)Parameters
type: OptimizerImageTypeThe image color type (Color, Gray, or BW) to query.
Returns:
The 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
intget_minor_version()Returns:
The minor PDF version number.Get the value of the Minor Version of the optimized document.
get_object_compression
OptimizerObjectCompressionget_object_compression()Returns:
The current object compression type setting.Get the value of the Object Compression of the optimized document.
get_option
boolget_option(OptimizerOptionoption)Parameters
option: OptimizerOptionThe optimization option to query.
Returns:
true if the option is enabled, false if it is disabled.Get the value of a single Optimizer Option.
get_recompression_type
OptimizerCompressionTypeget_recompression_type(OptimizerImageTypetype)Parameters
type: OptimizerImageTypeThe image color type (Color, Gray, or BW) to query.
Returns:
The 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
intget_resample_to_resolution(OptimizerImageTypetype)Parameters
type: OptimizerImageTypeThe image color type (Color, Gray, or BW) to query.
Returns:
The 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
voidoptimize(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
voidset_compression_quality(OptimizerImageTypetype, OptimizerCompressQualityvalue)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
voidset_major_version(intmajor)Parameters
major: intThe major PDF version number.
Returns:
voidSet the value for the Major Version for the optimized document.
set_max_resolution
voidset_max_resolution(OptimizerImageTypetype, intvalue)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
voidset_minor_version(intminor)Parameters
minor: intThe minor PDF version number.
Returns:
voidSet the value for the Minor Version for the optimized document.
set_object_compression
voidset_object_compression(OptimizerObjectCompressiontype)Parameters
type: OptimizerObjectCompressionThe desired object compression type.
Returns:
voidSet the value for the Object Compression for the optimized document.
set_option
voidset_option(OptimizerOptionoption, boolvalue)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
voidset_recompression_type(OptimizerImageTypetype, OptimizerCompressionTypevalue)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
voidset_resample_to_resolution(OptimizerImageTypetype, intvalue)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.