public static class

Optimizer.ImageSettings

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.Optimizer.ImageSettings

Class Overview

A class that stores downsampling/recompression settings for color and grayscale images.

Summary

Constants
int e_default The constant e_default
int e_flate The constant e_flate
int e_jpeg The constant e_jpeg
int e_jpeg2000 The constant e_jpeg2000
int e_none The constant e_none
int e_off The constant e_off
int e_retain The constant e_retain
Public Constructors
ImageSettings()
create an ImageSettings object with default options
Public Methods
void forceChanges(boolean force)
Sets whether image changes that grow the PDF file should be kept.
void forceRecompression(boolean force)
Sets whether recompression to the specified compression method should be forced when the image is not downsampled.
void setCompressionMode(int mode)
void setDownsampleMode(int mode)
void setImageDPI(double maximum, double resampling)
Sets the maximum and resampling dpi for images.
void setQuality(long quality)
Sets the quality for lossy compression modes from 1 to 10 where 10 is lossless (if possible) the default value is 5
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int e_default

The constant e_default

Constant Value: 1 (0x00000001)

public static final int e_flate

The constant e_flate

Constant Value: 1 (0x00000001)

public static final int e_jpeg

The constant e_jpeg

Constant Value: 2 (0x00000002)

public static final int e_jpeg2000

The constant e_jpeg2000

Constant Value: 3 (0x00000003)

public static final int e_none

The constant e_none

Constant Value: 4 (0x00000004)

public static final int e_off

The constant e_off

Constant Value: 0 (0x00000000)

public static final int e_retain

The constant e_retain

Constant Value: 0 (0x00000000)

Public Constructors

public ImageSettings ()

create an ImageSettings object with default options

Public Methods

public void forceChanges (boolean force)

Sets whether image changes that grow the PDF file should be kept. This is off by default.

Parameters
force if true all image changes will be kept.

public void forceRecompression (boolean force)

Sets whether recompression to the specified compression method should be forced when the image is not downsampled. By default the compression method for these images will not be changed.

Parameters
force if true the compression method for all images will be changed to the specified compression mode

public void setCompressionMode (int mode)

public void setDownsampleMode (int mode)

public void setImageDPI (double maximum, double resampling)

Sets the maximum and resampling dpi for images. By default these are set to 225 and 150 respectively.

Parameters
maximum the highest dpi of an image before it will be resampled
resampling the image dpi to resample to if an image is encountered over the maximum dpi

public void setQuality (long quality)

Sets the quality for lossy compression modes from 1 to 10 where 10 is lossless (if possible) the default value is 5