Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
com.foxit.sdk.addon.optimization.OptimizerSettings Class Reference
Inheritance diagram for com.foxit.sdk.addon.optimization.OptimizerSettings:

## Public Member Functions
| OptimizerSettings ()
| Constructor. More...
| OptimizerSettings (OptimizerSettings other)
| Constructor, with another optimizer settings object. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
boolean | isEmpty ()
| Check whether current object is empty or not. More...
void | setCleanUpOptions (int clean_up_options) throws com.foxit.sdk.PDFException
| Set optimization related options for cleaning up. More...
void | setColorGrayImageSettings (ImageSettings settings)
void | setColorImageSettings (ImageSettings settings) throws com.foxit.sdk.PDFException
| Set optimization related settings for color image. More...
void | setDiscardObjectsOptions (int discard_objects_options) throws com.foxit.sdk.PDFException
| Set optimization related options for discarding objects. More...
void | setDiscardUserDataOptions (int discard_userdata_options) throws com.foxit.sdk.PDFException
| Set optimization related options for discarding user data. More...
void | setGrayscaleImageSettings (ImageSettings settings) throws com.foxit.sdk.PDFException
| Set optimization related settings for grayscale image. More...
void | setMonoImageSettings (MonoImageSettings settings) throws com.foxit.sdk.PDFException
| Set optimization related settings for monochrome image. More...
void | setOptimizerOptions (int optimize_options) throws com.foxit.sdk.PDFException
| Set options to decide which kind of optimizer setting will be used for optimizing PDF document. More...
void | setTransparencyMode (int transparency_mode) throws com.foxit.sdk.PDFException
| Set optimization related options for doing transparency. More...
void | setUnembeddedFontSettings (UnembeddedFontSettings settings) throws com.foxit.sdk.PDFException
| Set optimization related settings for unembedding fonts. More...

## Static Public Attributes
static final int | e_CleanUpDiscardUnreferencedNamedDes = 0x10
| Discard unreferenced named destination.
static final int | e_CleanUpOptPageContent = 0x20
| Cleanup page content Change 0A,0D in the content stream to Spaces.
static final int | e_CleanUpRemoveInvalidBookmarks = 0x04
| Remove invalid bookmarks.
static final int | e_CleanUpRemoveInvalidLinks = 0x08
| Remove invalid links.
static final int | e_CleanUpUseFlateForNonEncodedStream = 0x01
| Use Flate to encode streams that are not encoded.
static final int | e_CleanUpUseFlateInsteadOfLZW = 0x02
| In streams that use LZW encoding, use Flate instead.
static final int | e_DiscardObjectsAlternateImages = 0x40
| Discard all alternate images. More...
static final int | e_DiscardObjectsBookmarks = 0x20
| Discard bookmarks.
static final int | e_DiscardObjectsDetectAndMergeImageFragment = 0x200
| Detect and merge image fragments.
static final int | e_DiscardObjectsDocumentTags = 0x80
| Discard document tags.
static final int | e_DiscardObjectsEmbeddedPageThumbnails = 0x08
| Discard embedded page thumbnails.
static final int | e_DiscardObjectsEmbeddedPrintSettings = 0x10
| Discard embedded print settings.
static final int | e_DiscardObjectsEmbeddedSearchIndex = 0x100
| Discard embedded search index.
static final int | e_DiscardObjectsFlattenFormFields = 0x02
| Flatten form fields.
static final int | e_DiscardObjectsFormActions = 0x01
| Discard all form submission, import and reset actions.
static final int | e_DiscardObjectsJavaScriptActions = 0x04
| Discard all JavaScript actions. More...
static final int | e_DiscardObjectsSmoothlinestocurves = 0x400
| smooth lines to curves
static final int | e_DiscardUserAllData = 0x40
| discard tag user data
static final int | e_DiscardUserDataAllAnnotsFormsAndMultimedia = 0x01
| Discard all annotations, forms and multimedia.
static final int | e_DiscardUserDataDocumentInfoAndMetaData = 0x04
| Discard document information and metadata.
static final int | e_DiscardUserDataExternalCrossReferences = 0x02
| Discard external cross references.
static final int | e_DiscardUserDataFileAttchments = 0x08
| Discard file attachments.
static final int | e_DiscardUserDataLayer = 0x20
| Discard hidden layer content and flatten visible layers.
static final int | e_DiscardUserDataPrivateDataOfOtherApp = 0x10
| Discard private data of other applications.
static final int | e_OptimizerCleanUp = 0x02
| Optimize PDF document by cleaning up.
static final int | e_OptimizerCompressImages = 0x01
| Optimize PDF document by compressing images.
static final int | e_OptimizerDiscardObjects = 0x04
| Optimize PDF document by discarding objects.
static final int | e_OptimizerDiscardUserData = 0x10
| Optimize PDF document by discarding user data.
static final int | e_OptimizerTransparency = 0x20
| Optimize PDF document by doing transparency.
static final int | e_OptimizerUnembeddedFonts = 0x08
| Optimize PDF document by unembedding some embedded fonts.
static final int | e_TransparencyModeHighResolution = 2
| Transparency mode: high resolution. More...
static final int | e_TransparencyModeLowResolution = 0
| Transparency mode: low resolution. More...
static final int | e_TransparencyModeMediumResolution = 1
| Transparency mode: medium resolution. More...

## Detailed Description

This class represents settings for optimizing a PDF document. It would be used in class Optimizer .

See also
  Optimizer

## Constructor & Destructor Documentation

## ◆ OptimizerSettings() [1/2]

com.foxit.sdk.addon.optimization.OptimizerSettings.OptimizerSettings | ( |  | ) |

Constructor.

This constructor is to construct a optimizer settings object with default setting options. User can also call "set" methods in this class to change setting options. Please refer to comment in other settings class (which can be set to current object) for more details about what default setting options are.

## ◆ OptimizerSettings() [2/2]

com.foxit.sdk.addon.optimization.OptimizerSettings.OptimizerSettings | ( | OptimizerSettings | other | ) |

Constructor, with another optimizer settings object.

Parameters

  [in] | other | Another optimizer settings object.

## Member Function Documentation

## ◆ delete()

synchronized void com.foxit.sdk.addon.optimization.OptimizerSettings.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

Reimplemented from com.foxit.sdk.common.Base.

## ◆ isEmpty()

boolean com.foxit.sdk.addon.optimization.OptimizerSettings.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.

## ◆ setCleanUpOptions()

void com.foxit.sdk.addon.optimization.OptimizerSettings.setCleanUpOptions | ( | int | clean_up_options | ) | throws com.foxit.sdk.PDFException

Set optimization related options for cleaning up.

For a newly constructed object, if this function is not called to set any clean-up options, that means not to do clean-up optimization. Clean-up options set by this function are useful only when option value com.foxit.sdk.addon.optimization.OptimizerSettings.e_OptimizerCleanUp is set by function OptimizerSettings.setOptimizerOptions .

Parameters

  [in] | clean_up_options | Optimization related options for cleaning up. 0 means not to do clean-up optimization. Please refer to values starting from com.foxit.sdk.addon.optimization.OptimizerSettings.e_CleanUpUseFlateForNonEncodedStream and this can be one or a combination of these values.

Returns
  None.

## ◆ setColorGrayImageSettings()

void com.foxit.sdk.addon.optimization.OptimizerSettings.setColorGrayImageSettings | ( | ImageSettings | settings | ) |

Deprecated:
  Current function has been deprecated since Foxit PDF SDK 10.0. This function will not have any effect on OptimizerSettings any more. For setting color image, please call function OptimizerSettings.setColorImageSettings . Please refer to SetColorImageSettings related function in OptimizerSettings for more details. For setting grayscale image, please call function OptimizerSettings.setGrayscaleImageSettings . Please refer to SetGrayscaleImageSettings related function in OptimizerSettings for more details.

For a newly constructed object, if this function is not called to set any color/gray image settings, that means to use default color/gray image settings. Please refer to comment in class ImageSettings for default values.
ImageSettings set by this function is useful only when option value com.foxit.sdk.addon.optimization.OptimizerSettings.e_OptimizerCompressImages is set by function OptimizerSettings.setOptimizerOptions .

Parameters

  [in] | settings | Optimization related settings for color and grayscale images.

Returns
  None.

## ◆ setColorImageSettings()

void com.foxit.sdk.addon.optimization.OptimizerSettings.setColorImageSettings | ( | ImageSettings | settings | ) | throws com.foxit.sdk.PDFException

Set optimization related settings for color image.

For a newly constructed object, if this function is not called to set any color image settings, that means to use default color image settings. Please refer to comment in class ImageSettings for default values.
ImageSettings set by this function is useful only when option value com.foxit.sdk.addon.optimization.OptimizerSettings.e_OptimizerCompressImages is set by function OptimizerSettings.setOptimizerOptions .

Parameters

  [in] | settings | Optimization related settings for color images.

Returns
  None.

## ◆ setDiscardObjectsOptions()

void com.foxit.sdk.addon.optimization.OptimizerSettings.setDiscardObjectsOptions | ( | int | discard_objects_options | ) | throws com.foxit.sdk.PDFException

Set optimization related options for discarding objects.

For a newly constructed object, if this function is not called to set any discard-objects options, that means not to do discard-objects optimization. Discard-objects options set by this function are useful only when option value com.foxit.sdk.addon.optimization.OptimizerSettings.e_OptimizerDiscardObjects is set by function OptimizerSettings.setOptimizerOptions .

Parameters

  [in] | discard_objects_options | Optimization related options for discarding objects. 0 means not to do discarding-objects optimization. Please refer to values starting from com.foxit.sdk.addon.optimization.OptimizerSettings.e_DiscardObjectsFormActions and this can be one or a combination of these values.

Returns
  None.

## ◆ setDiscardUserDataOptions()

void com.foxit.sdk.addon.optimization.OptimizerSettings.setDiscardUserDataOptions | ( | int | discard_userdata_options | ) | throws com.foxit.sdk.PDFException

Set optimization related options for discarding user data.

For a newly constructed object, if this function is not called to set any discard-userdata options, that means not to do discard-userdata optimization. Discard-userdata options set by this function are useful only when option value com.foxit.sdk.addon.optimization.OptimizerSettings.e_OptimizerDiscardUserData is set by function OptimizerSettings.setOptimizerOptions .

Parameters

  [in] | discard_userdata_options | Optimization related options for discarding user data. 0 means not to do discarding-userdata optimization. Please refer to values starting from com.foxit.sdk.addon.optimization.OptimizerSettings.e_DiscardUserDataAllAnnotsFormsAndMultimedia and this can be one or a combination of these values.

Returns
  None.

## ◆ setGrayscaleImageSettings()

void com.foxit.sdk.addon.optimization.OptimizerSettings.setGrayscaleImageSettings | ( | ImageSettings | settings | ) | throws com.foxit.sdk.PDFException

Set optimization related settings for grayscale image.

For a newly constructed object, if this function is not called to set any grayscale image settings, that means to use default grayscale image settings. Please refer to comment in class ImageSettings for default values.
ImageSettings set by this function is useful only when option value com.foxit.sdk.addon.optimization.OptimizerSettings.e_OptimizerCompressImages is set by function OptimizerSettings.setOptimizerOptions .

Parameters

  [in] | settings | Optimization related settings for grayscale images.

Returns
  None.

## ◆ setMonoImageSettings()

void com.foxit.sdk.addon.optimization.OptimizerSettings.setMonoImageSettings | ( | MonoImageSettings | settings | ) | throws com.foxit.sdk.PDFException

Set optimization related settings for monochrome image.

For a newly constructed object, if this function is not called to set any monochrome image settings, that means to use default monochrome image settings. Please refer to comment in class MonoImageSettings for detail values.
MonoImageSettings set by this function is useful only when option value com.foxit.sdk.addon.optimization.OptimizerSettings.e_OptimizerCompressImages is set by function OptimizerSettings.setOptimizerOptions .

Parameters

  [in] | settings | Optimization related settings for monochrome images.

Returns
  None.

## ◆ setOptimizerOptions()

void com.foxit.sdk.addon.optimization.OptimizerSettings.setOptimizerOptions | ( | int | optimize_options | ) | throws com.foxit.sdk.PDFException

Set options to decide which kind of optimizer setting will be used for optimizing PDF document.

For a newly constructed object, if this function is not called to set any optimizer options, that means no optimizer setting is useful.

Parameters

  [in] | optimize_options | The options to decide which kind of optimizer setting will be used for optimizing PDF document. 0 means no optimizer setting of any kind is useful. Please refer to values starting from com.foxit.sdk.addon.optimization.OptimizerSettings.e_OptimizerCompressImages and this can be one or a combination of these values.

Returns
  None.

## ◆ setTransparencyMode()

void com.foxit.sdk.addon.optimization.OptimizerSettings.setTransparencyMode | ( | int | transparency_mode | ) | throws com.foxit.sdk.PDFException

Set optimization related options for doing transparency.

For a newly constructed object, if this function is not called to set any transparency mode, that means the transparency mode is com.foxit.sdk.addon.optimization.OptimizerSettings.e_TransparencyModeLowResolution default.

Parameters

  [in] | transparency_mode | Optimization related options for transparency mode. Please refer to values starting from com.foxit.sdk.addon.optimization.OptimizerSettings.e_TransparencyModeLowResolution and this must be one of these values. Default value is com.foxit.sdk.addon.optimization.OptimizerSettings.e_TransparencyModeLowResolution .

Returns
  None.

## ◆ setUnembeddedFontSettings()

void com.foxit.sdk.addon.optimization.OptimizerSettings.setUnembeddedFontSettings | ( | UnembeddedFontSettings | settings | ) | throws com.foxit.sdk.PDFException

Set optimization related settings for unembedding fonts.

For a newly constructed object, if this function is not called to set any unembedded fonts settings, that means to no font is to be unembedded. UnembeddedFontSettings set by this function is useful only when option value com.foxit.sdk.addon.optimization.OptimizerSettings.e_OptimizerUnembeddedFonts is set by function OptimizerSettings.setOptimizerOptions .

Parameters

  [in] | settings | Optimization related settings for unembedding fonts.

Returns
  None.

## Member Data Documentation

## ◆ e_DiscardObjectsAlternateImages

final int com.foxit.sdk.addon.optimization.OptimizerSettings.e_DiscardObjectsAlternateImages = 0x40
| static

Discard all alternate images.

Some PDF documents include multiple versions of the same image for different purposes, such as low-resolution on-screen viewing and high-resolution printing. If this option value is set to be used, that means to remove all versions of an image except the one destined for on-screen viewing.

## ◆ e_DiscardObjectsJavaScriptActions

final int com.foxit.sdk.addon.optimization.OptimizerSettings.e_DiscardObjectsJavaScriptActions = 0x04
| static

Discard all JavaScript actions.

Currently, it can not remove the javascript action in "OpenAction" of catalog.

## ◆ e_TransparencyModeHighResolution

final int com.foxit.sdk.addon.optimization.OptimizerSettings.e_TransparencyModeHighResolution = 2
| static

Transparency mode: high resolution.

High resolution includes: Transparency level: 100; Line Art and Text: 1200; Gradient and Meshes: 300; Convert All Text to Outlines: False; Convert All Strokes to Outlines: False; Clip Complex Regions: True; Preserve Overprint Settings: True.

## ◆ e_TransparencyModeLowResolution

final int com.foxit.sdk.addon.optimization.OptimizerSettings.e_TransparencyModeLowResolution = 0
| static

Transparency mode: low resolution.

Low resolution includes: Transparency level: 75; Line Art and Text: 288; Gradient and Meshes: 144; Convert All Text to Outlines: False; Convert All Strokes to Outlines: True; Clip Complex Regions: False; Preserve Overprint Settings: True.

## ◆ e_TransparencyModeMediumResolution

final int com.foxit.sdk.addon.optimization.OptimizerSettings.e_TransparencyModeMediumResolution = 1
| static

Transparency mode: medium resolution.

Medium resolution includes: Transparency level: 75; Line Art and Text: 300; Gradient and Meshes: 150; Convert All Text to Outlines: False; Convert All Strokes to Outlines: True; Clip Complex Regions: True; Preserve Overprint Settings: True.