pdftools_sdk.optimization.profiles.minimal_file_size
Classes
The optimization profile producing a minimal file size |
- class pdftools_sdk.optimization.profiles.minimal_file_size.MinimalFileSize[source]
Bases:
ProfileThe optimization profile producing a minimal file size
This profile optimizes the output PDF for minimal file size. This is achieved by using a varied palette of image compression algorithms, appropriate resolution setting and higher compression rates at the price of slightly lower image quality.
The output file size is further reduced by converting Embedded Type1 (PostScript) fonts to Type1C (Compact Font Format) and removing metadata and output intents (see pdftools_sdk.optimization.profiles.profile.Profile.removal_options). Also Spider (web capture) information is removed.
Images above 182 DPI are down-sampled and recompressed to 130 DPI. This leads to smaller output files. The property pdftools_sdk.optimization.profiles.minimal_file_size.MinimalFileSize.resolution_d_p_i has influence on both values.
When an image is recompressed, the pdftools_sdk.optimization.compression_algorithm_selection.CompressionAlgorithmSelection.BALANCED strategy is used; this can be overridden through the property pdftools_sdk.optimization.profiles.profile.Profile.image_recompression_options.
With this profile, the output PDF version is updated to PDF 1.7 or higher and PDF/A conformance removed.
- property resolution_d_p_i: float | None
The target resolution of images in DPI
The target resolution in DPI (dots per inch) for color and grayscale images.
Images with a resolution above pdftools_sdk.optimization.profiles.minimal_file_size.MinimalFileSize.threshold_d_p_i are down-sampled.
Valid values are in the range 1.0 to 10000.
If None, then resolution setting is disabled.
Default: 130.
- Returns:
Optional[float]
- property threshold_d_p_i: float
The threshold resolution of images in DPI.
The threshold resolution in DPI (dots per inch) to selectively activate downsampling for color and grayscale images.
Valid values are in the range 1.0 to 10000. To deactivate down-sampling of images set pdftools_sdk.optimization.profiles.minimal_file_size.MinimalFileSize.resolution_d_p_i to None.
Default: 1.4 times pdftools_sdk.optimization.profiles.minimal_file_size.MinimalFileSize.resolution_d_p_i.
- Returns:
float