Foxit PDF SDK
com.foxit.sdk.addon.optimization.ImageSettings Class Reference
Inheritance diagram for com.foxit.sdk.addon.optimization.ImageSettings:
com.foxit.sdk.common.Base

Public Member Functions

 ImageSettings ()
 Constructor.
More...
 
 ImageSettings (ImageSettings other)
 Constructor, with another image setting object.
More...
 
boolean isEmpty ()
 Check whether current object is empty or not.
More...
 
void setCompressionMode (int mode) throws com.foxit.sdk.PDFException
 Set compression mode used for optimizing color/gray images in a PDF document.
More...
 
void setImageDPI (int dpi) throws com.foxit.sdk.PDFException
 Set the image DPI used for optimizing color/gray images in a PDF document.
More...
 
void setQuality (int quality) throws com.foxit.sdk.PDFException
 Set the quality for lossy compression modes, used for optimizing color/gray images in a PDF document.
More...
 
void setStretchMode (int mode) throws com.foxit.sdk.PDFException
 Set stretch mode used for optimizing color/gray images in a PDF document.
More...
 

Static Public Attributes

static final int e_ImageCompressHigh = 10003
 Compression mode: high.

 
static final int e_ImageCompressjpeg = 10005
 Compression mode: jpeg.

 
static final int e_ImageCompressjpeg2000 = 10006
 Compression mode: jpeg2000.

 
static final int e_ImageCompressRetain = 10007
 Compression mode: retain, which means no compression.

 
static final int e_StretchBicubic = 0x80
 When this is set, that means to do bicubic interpolation for zooming.

 
static final int e_StretchDownsample = 0x04
 When this is set, that means not to do halftone for shrinking or rotating.

 
static final int e_StretchInterpol = 0x20
 When this is set, that means to do interpolation for zooming.

 
static final int e_StretchNoSmooth = 0x100
 When this is set, that means not to do any interpolation for stretching.

 
static final int e_StretchOff = 0x00
 When this is set, that means do without stretching.

 

Detailed Description

This class represents downsampling/recompression settings for color and grayscale images. This class object can be set to class OptimizerSettings and then be used to optimize a PDF document.

See also
OptimizerSettings

Constructor & Destructor Documentation

◆ ImageSettings() [1/2]

com.foxit.sdk.addon.optimization.ImageSettings.ImageSettings ( )

Constructor.

This constructor is to construct a color/gray image settings object with default setting options. User can also calling "set" methods in this class to change these setting options. Please refer to comment of these "set" methods for more details about default values.

◆ ImageSettings() [2/2]

com.foxit.sdk.addon.optimization.ImageSettings.ImageSettings ( ImageSettings  other)

Constructor, with another image setting object.

Parameters
[in]otherAnother ImageSettings object.

Member Function Documentation

◆ isEmpty()

boolean com.foxit.sdk.addon.optimization.ImageSettings.isEmpty ( )

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.

◆ setCompressionMode()

void com.foxit.sdk.addon.optimization.ImageSettings.setCompressionMode ( int  mode) throws com.foxit.sdk.PDFException

Set compression mode used for optimizing color/gray images in a PDF document.

For a newly constructed object, if this function is not called to set option, that means to use com.foxit.sdk.addon.optimization.ImageSettings.e_ImageCompressjpeg as the deault value of this option.

Parameters
[in]modeImage compression mode. Please refer to values starting from com.foxit.sdk.addon.optimization.ImageSettings.e_ImageCompressHigh and this should be one of these values.
Returns
None.

◆ setImageDPI()

void com.foxit.sdk.addon.optimization.ImageSettings.setImageDPI ( int  dpi) throws com.foxit.sdk.PDFException

Set the image DPI used for optimizing color/gray images in a PDF document.

For a newly constructed object, if this function is not called to set option, that means to use 150 as the deault value of this option.

Parameters
[in]dpiDPI value.
Returns
None.

◆ setQuality()

void com.foxit.sdk.addon.optimization.ImageSettings.setQuality ( int  quality) throws com.foxit.sdk.PDFException

Set the quality for lossy compression modes, used for optimizing color/gray images in a PDF document.

For a newly constructed object, if this function is not called to set this option, that means to use 2 as the deault value of this option.

Parameters
[in]qualityQuality value for lossy compression modes. Valid range: from 1 to 5. 5 means lossless (if possible).
Returns
None.

◆ setStretchMode()

void com.foxit.sdk.addon.optimization.ImageSettings.setStretchMode ( int  mode) throws com.foxit.sdk.PDFException

Set stretch mode used for optimizing color/gray images in a PDF document.

For a newly constructed object, if this function is not called to set this option, that means to use com.foxit.sdk.addon.optimization.ImageSettings.e_StretchBicubic as the deault value of this option.

Parameters
[in]modeStretch mode. Please refer to values starting from com.foxit.sdk.addon.optimization.ImageSettings.e_StretchOff and this should be one of these values.
Returns
None.