public class JpegCompressor extends Object implements IImageProcessor
PdfImageXObject
has /Mask
entry as PdfArray
then it will be converted into mask as a stream.Constructor and Description |
---|
JpegCompressor(double compressionLevel)
Creates an instance of JPEG image processor.
|
Modifier and Type | Method and Description |
---|---|
com.itextpdf.kernel.pdf.xobject.PdfImageXObject |
processImage(com.itextpdf.kernel.pdf.xobject.PdfImageXObject objectToProcess,
OptimizationSession session)
Compresses a JPEG image presented as
PdfImageXObject with the configured compression
level. |
public JpegCompressor(double compressionLevel)
compressionLevel
- is a compression coefficient. The value should be in range [0.0, 1.0]public com.itextpdf.kernel.pdf.xobject.PdfImageXObject processImage(com.itextpdf.kernel.pdf.xobject.PdfImageXObject objectToProcess, OptimizationSession session) throws IOException
PdfImageXObject
with the configured compression
level.processImage
in interface IImageProcessor
objectToProcess
- is a PdfImageXObject
representing the imagesession
- is an auxiliary object used to support share data between stages of
optimization processIOException
- if image cannot be compressed as JPEG imageCopyright © 1998–2024 iText Group NV. All rights reserved.