Package net.webpdf.wsclient.openapi
Class OperationSizeOptimization
- java.lang.Object
-
- net.webpdf.wsclient.openapi.OperationSizeOptimization
-
public class OperationSizeOptimization extends Object
If you use a JPEG \"image type element,\" the file size can be automatically optimized. The corresponding optimization routine will attempt to limit the file to a max. size by gradually reducing the JPEG quality until the image is smaller than a specific size. If the \"sizeOptimization\" block is present, the image will be optimized. If it is not present, the image will not be optimized further after being exported. **Important:** Please note that optimization can make the graphic export operation significantly slower. In addition to this, make sure to use values for the \"dpi\", \"height\", and \"width\" parameters that ensure that the size you want can actually be reached with compression.
-
-
Field Summary
Fields Modifier and Type Field Description static StringJSON_PROPERTY_MAX_RETRIESstatic StringJSON_PROPERTY_MAX_SIZEstatic StringJSON_PROPERTY_STEP_SIZE
-
Constructor Summary
Constructors Constructor Description OperationSizeOptimization()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)@Nullable IntegergetMaxRetries()Used to specify the number of runs that should be used for optimization.@Nullable IntegergetMaxSize()Used to define the maximum size of the JPEG file (file size), in bytes, that should be reached.@Nullable IntegergetStepSize()Used to define the increment by which the JPEG quality (jpegQuality) should be reduced every run in order to reach the desired file size.inthashCode()OperationSizeOptimizationmaxRetries(Integer maxRetries)OperationSizeOptimizationmaxSize(Integer maxSize)voidsetMaxRetries(Integer maxRetries)voidsetMaxSize(Integer maxSize)voidsetStepSize(Integer stepSize)OperationSizeOptimizationstepSize(Integer stepSize)StringtoString()
-
-
-
Field Detail
-
JSON_PROPERTY_MAX_RETRIES
public static final String JSON_PROPERTY_MAX_RETRIES
- See Also:
- Constant Field Values
-
JSON_PROPERTY_MAX_SIZE
public static final String JSON_PROPERTY_MAX_SIZE
- See Also:
- Constant Field Values
-
JSON_PROPERTY_STEP_SIZE
public static final String JSON_PROPERTY_STEP_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
maxRetries
public OperationSizeOptimization maxRetries(Integer maxRetries)
-
getMaxRetries
@Nullable public @Nullable Integer getMaxRetries()
Used to specify the number of runs that should be used for optimization. If the target size cannot be reached after the specified number of runs, the operation will be cancelled and an error code will be returned.- Returns:
- maxRetries
-
setMaxRetries
public void setMaxRetries(Integer maxRetries)
-
maxSize
public OperationSizeOptimization maxSize(Integer maxSize)
-
getMaxSize
@Nullable public @Nullable Integer getMaxSize()
Used to define the maximum size of the JPEG file (file size), in bytes, that should be reached. The optimization routine will be successfully completed if the file reaches or falls below the specified file size. Make sure to use a value > 0; otherwise, an error will be thrown.- Returns:
- maxSize
-
setMaxSize
public void setMaxSize(Integer maxSize)
-
stepSize
public OperationSizeOptimization stepSize(Integer stepSize)
-
getStepSize
@Nullable public @Nullable Integer getStepSize()
Used to define the increment by which the JPEG quality (jpegQuality) should be reduced every run in order to reach the desired file size. If the values for maxRetries and stepSize result in an illegal JPEG quality value being reached, the operation will be cancelled and an error code will be returned.- Returns:
- stepSize
-
setStepSize
public void setStepSize(Integer stepSize)
-
-