Class MinimalFileSize
- java.lang.Object
-
- com.pdftools.internal.NativeBase
-
- com.pdftools.internal.NativeObject
-
- com.pdftools.optimization.profiles.Profile
-
- com.pdftools.optimization.profiles.MinimalFileSize
-
public class MinimalFileSize extends Profile
The 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
Profile.getRemovalOptions()
). 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
setResolutionDPI(java.lang.Double)
has influence on both values.When an image is recompressed, the
pdftools.optimization.CompressionAlgorithmSelection.BALANCED
strategy is used; this can be overridden through the propertyProfile.getImageRecompressionOptions()
.With this profile, the output PDF version is updated to PDF 1.7 or higher and PDF/A conformance removed.
-
-
Constructor Summary
Constructors Constructor Description MinimalFileSize()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Double
getResolutionDPI()
The target resolution of images in DPI (Getter)double
getThresholdDPI()
The threshold resolution of images in DPI.void
setResolutionDPI(java.lang.Double value)
The target resolution of images in DPI (Setter)void
setThresholdDPI(double value)
The threshold resolution of images in DPI.-
Methods inherited from class com.pdftools.optimization.profiles.Profile
getCopyMetadata, getFontOptions, getImageRecompressionOptions, getRemovalOptions, setCopyMetadata
-
Methods inherited from class com.pdftools.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
getResolutionDPI
public java.lang.Double getResolutionDPI()
The target resolution of images in DPI (Getter)
The target resolution in DPI (dots per inch) for color and grayscale images.
Images with a resolution above
getThresholdDPI()
are down-sampled.Valid values are in the range 1.0 to 10000.
If
null
, then resolution setting is disabled.Default:
130
.
-
setResolutionDPI
public void setResolutionDPI(java.lang.Double value)
The target resolution of images in DPI (Setter)
The target resolution in DPI (dots per inch) for color and grayscale images.
Images with a resolution above
getThresholdDPI()
are down-sampled.Valid values are in the range 1.0 to 10000.
If
null
, then resolution setting is disabled.Default:
130
.- Throws:
java.lang.IllegalArgumentException
- The given value is outside of range 1.0 to 10000.0.
-
getThresholdDPI
public double getThresholdDPI()
The threshold resolution of images in DPI. (Getter)
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
getResolutionDPI()
tonull
.Default:
1.4
timesgetResolutionDPI()
.
-
setThresholdDPI
public void setThresholdDPI(double value)
The threshold resolution of images in DPI. (Setter)
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
getResolutionDPI()
tonull
.Default:
1.4
timesgetResolutionDPI()
.- Throws:
java.lang.IllegalArgumentException
- The given value is outside of range 1.0 to 10000.0.
-
-