pdftools_sdk.optimization.profiles.mrc
Classes
|
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.
- 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:
pdftools_sdk.optimization.compression_algorithm_selection.CompressionAlgorithmSelection.PRESERVEQUALITY
algorithm: 1.pdftools_sdk.optimization.compression_algorithm_selection.CompressionAlgorithmSelection.BALANCED
algorithm: 0.25.pdftools_sdk.optimization.compression_algorithm_selection.CompressionAlgorithmSelection.SPEED
algorithm: 0.25.
- 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 (cutout pictures) by the MRC algorithm.
Default is False.
- Returns:
bool