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 image
session
- is an auxiliary object used to support share data between stages of optimization process
IOException
- if image cannot be compressed as JPEG image
Copyright © 1998–2020 iText Group NV. All rights reserved.