pdftools_sdk.optimization.profiles.mrc

Classes

Mrc()

The optimization profile suitable for documents with Mixed Raster Content

class pdftools_sdk.optimization.profiles.mrc.Mrc[source]

Bases: Profile

The optimization profile suitable for documents with Mixed Raster Content

Reduce the file size for documents containing large images, e.g. scanned pages, while maintaining the readability of text. This is accomplished by separating the images into a foreground, background and a mask layer. The foreground and background layers are heavily down-sampled and compressed. The textual information is stored in the mask with a lossless compression type. Additionally, redundant objects are removed, resources are optimized and embedded fonts are merged.

__init__()[source]
property layer_compression_quality: float

The image quality for MRC foreground and background layers

This is a value between 0 (lowest quality) and 1 (highest quality).

Default:

Returns:

float

property layer_resolution_d_p_i: float | None

The target resolution in DPI (dots per inch) for downsampling MRC foreground and background layers

Valid values are 1, or 10000, or in between. Set to None to deactivate downsampling of images.

Default is 70.

Returns:

Optional[float]

property recognize_pictures: bool

The option to recognize photographic regions when doing MRC.

Regardless of this property’s setting, monochrome (grayscale) images are always treated as entire photographic regions (cut­out pictures) by the MRC algorithm.

Default is False.

Returns:

bool