PDFOptimizer Class Documentation

classPDFOptimizer

Namespace: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()

Member Function Documentation

get_compression_quality

OptimizerCompressQualityget_compression_quality(OptimizerImageTypetype)

Parameters

type: OptimizerImageType

The 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: OptimizerImageType

The 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: OptimizerOption

The 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: OptimizerImageType

The 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: OptimizerImageType

The 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.

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:

void

Optimize 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: OptimizerImageType

The image color type (Color, Gray, or BW) to set.

value: OptimizerCompressQuality

The compression quality level to apply.

Returns:

void

Set 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: int

The major PDF version number.

Returns:

void

Set the value for the Major Version for the optimized document.

set_max_resolution

voidset_max_resolution(OptimizerImageTypetype, intvalue)

Parameters

type: OptimizerImageType

The image color type (Color, Gray, or BW) to set.

value: int

The maximum resolution in DPI.

Returns:

void

Set 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: int

The minor PDF version number.

Returns:

void

Set the value for the Minor Version for the optimized document.

set_option

voidset_option(OptimizerOptionoption, boolvalue)

Parameters

option: OptimizerOption

The optimization option to set.

value: bool

true to enable the option, false to disable it.

Returns:

void

Set the value of a single Optimizer option.

set_recompression_type

voidset_recompression_type(OptimizerImageTypetype, OptimizerCompressionTypevalue)

Parameters

type: OptimizerImageType

The image color type (Color, Gray, or BW) to set.

value: OptimizerCompressionType

The compression type to apply.

Returns:

void

Set 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: OptimizerImageType

The image color type (Color, Gray, or BW) to set.

value: int

The target resolution in DPI.

Returns:

void

Set 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.