public class PDFImageOptimizationNode extends Node
A node for optimizing the size of a PDF with embedded images. This is achieved by resizing those embedded images whose resolution exceeds a given threshold.
Its worker respects PageCountLimit
s.
Modifier and Type | Class and Description |
---|---|
static class |
PDFImageOptimizationNode.PageSize
Predefined values for the size of the resulting PDF document.
|
Node.Cardinality
Modifier and Type | Field and Description |
---|---|
static float |
MAX_JPEG_QUALITY
Maximal value allowed for JPEG image quality.
|
static float |
MIN_JPEG_QUALITY
Minimal value allowed for JPEG image quality.
|
Constructor and Description |
---|
PDFImageOptimizationNode()
Creates an instance of this class with a maximal resolution of 300 dpi and JPEG image quality of 0.75.
|
PDFImageOptimizationNode(float maxResolution,
float jpegQuality)
Creates an instance of this class.
|
Modifier and Type | Method and Description |
---|---|
float |
getJPEGQuality()
Gets the JPEG image quality.
|
float |
getMaxResolution()
Gets the maximal resolution an embedded image should have after optimization.
|
PDFImageOptimizationNode.PageSize |
getTargetPageSize()
Gets the target page size.
|
String |
getWorkerClassName()
Return the node's associated
NodeWorker full qualified class's
name. |
void |
setJPEGQuality(float jpegQuality)
Sets the JPEG image quality.
|
void |
setMaxResolution(float maxResolution)
Sets the maximal resolution an embedded image should have after optimization.
|
void |
setTargetPageSize(PDFImageOptimizationNode.PageSize targetPageSize)
Sets the target page size (optional).
|
addTransportReceiver, appendSuccessor, apply, equals, getInputCardinality, getJob, getOutputCardinality, getPredecessors, getSubsidiaryNodes, getSuccessors, getTransportSender, getUUID, hashCode, initialize, prependPredecessor, remove, validateConfiguration
public static final float MIN_JPEG_QUALITY
public static final float MAX_JPEG_QUALITY
public PDFImageOptimizationNode()
public PDFImageOptimizationNode(float maxResolution, float jpegQuality)
maxResolution
- the maximum resolution an embedded image should have after optimizationjpegQuality
- the quality of resized JPEG imagesIllegalArgumentException
- if jpegQuality < 0.0f or jpegQuality >
1.0fpublic float getMaxResolution()
public void setMaxResolution(float maxResolution)
maxResolution
- the maximal resolution (must be greater zero)public float getJPEGQuality()
public PDFImageOptimizationNode.PageSize getTargetPageSize()
public void setTargetPageSize(PDFImageOptimizationNode.PageSize targetPageSize)
null
the original page size will
be used to calculate the image resolution.targetPageSize
- public void setJPEGQuality(float jpegQuality)
jpegQuality
- the image qualityIllegalArgumentException
- if jpegQuality < 0.0f or jpegQuality >
1.0fpublic String getWorkerClassName()
Node
Return the node's associated
NodeWorker
full qualified class's
name. By default, the worker class name is
This behavior can be overridden in concrete subclasses.
getWorkerClassName
in class Node
Copyright © 2017 levigo holding gmbh. All rights reserved.