Foxit PDF SDK

Public Types | Public Member Functions | List of all members
foxit.addon.optimization.OptimizerSettings Class Reference
Inheritance diagram for foxit.addon.optimization.OptimizerSettings:

## Public Types
enum | CleanUpOptions { CleanUpOptions.e_CleanUpUseFlateForNonEncodedStream = 0x01, CleanUpOptions.e_CleanUpUseFlateInsteadOfLZW = 0x02, CleanUpOptions.e_CleanUpRemoveInvalidBookmarks = 0x04, CleanUpOptions.e_CleanUpRemoveInvalidLinks = 0x08, CleanUpOptions.e_CleanUpDiscardUnreferencedNamedDes = 0x10, CleanUpOptions.e_CleanUpOptPageContent = 0x20 }
| Enumeration for cleaning up options. More...
enum | DiscardObjectsOptions { DiscardObjectsOptions.e_DiscardObjectsFormActions = 0x01, DiscardObjectsOptions.e_DiscardObjectsFlattenFormFields = 0x02, DiscardObjectsOptions.e_DiscardObjectsJavaScriptActions = 0x04, DiscardObjectsOptions.e_DiscardObjectsEmbeddedPageThumbnails = 0x08, DiscardObjectsOptions.e_DiscardObjectsEmbeddedPrintSettings = 0x10, DiscardObjectsOptions.e_DiscardObjectsBookmarks = 0x20, DiscardObjectsOptions.e_DiscardObjectsAlternateImages = 0x40, DiscardObjectsOptions.e_DiscardObjectsDocumentTags = 0x80, DiscardObjectsOptions.e_DiscardObjectsEmbeddedSearchIndex = 0x100, DiscardObjectsOptions.e_DiscardObjectsDetectAndMergeImageFragment = 0x200, DiscardObjectsOptions.e_DiscardObjectsSmoothlinestocurves = 0x400 }
| Enumeration for discarding objects options. More...
enum | DiscardUserDataOptions { DiscardUserDataOptions.e_DiscardUserDataAllAnnotsFormsAndMultimedia = 0x01, DiscardUserDataOptions.e_DiscardUserDataExternalCrossReferences = 0x02, DiscardUserDataOptions.e_DiscardUserDataDocumentInfoAndMetaData = 0x04, DiscardUserDataOptions.e_DiscardUserDataFileAttchments = 0x08, DiscardUserDataOptions.e_DiscardUserDataPrivateDataOfOtherApp = 0x10, DiscardUserDataOptions.e_DiscardUserDataLayer = 0x20, DiscardUserDataOptions.e_DiscardUserAllData = 0x40 }
| Enumeration for discarding user data options. More...
enum | OptimizerOptions { OptimizerOptions.e_OptimizerCompressImages = 0x01, OptimizerOptions.e_OptimizerCleanUp = 0x02, OptimizerOptions.e_OptimizerDiscardObjects = 0x04, OptimizerOptions.e_OptimizerUnembeddedFonts = 0x08, OptimizerOptions.e_OptimizerDiscardUserData = 0x10, OptimizerOptions.e_OptimizerTransparency = 0x20 }
| Enumeration for optimizer options. More...
enum | TransparencyMode { TransparencyMode.e_TransparencyModeLowResolution = 0, TransparencyMode.e_TransparencyModeMediumResolution = 1, TransparencyMode.e_TransparencyModeHighResolution = 2 }
| Enumeration for transparency mode. More...

## Public Member Functions
| OptimizerSettings ()
| Constructor. More...
| OptimizerSettings (OptimizerSettings other)
| Constructor, with another optimizer settings object. More...
bool | IsEmpty ()
| Check whether current object is empty or not. More...
void | SetCleanUpOptions (int clean_up_options)
| Set optimization related options for cleaning up. More...
void | SetColorGrayImageSettings (ImageSettings settings)
void | SetColorImageSettings (ImageSettings settings)
| Set optimization related settings for color image. More...
void | SetDiscardObjectsOptions (int discard_objects_options)
| Set optimization related options for discarding objects. More...
void | SetDiscardUserDataOptions (int discard_userdata_options)
| Set optimization related options for discarding user data. More...
void | SetGrayscaleImageSettings (ImageSettings settings)
| Set optimization related settings for grayscale image. More...
void | SetMonoImageSettings (MonoImageSettings settings)
| Set optimization related settings for monochrome image. More...
void | SetOptimizerOptions (int optimize_options)
| Set options to decide which kind of optimizer setting will be used for optimizing PDF document. More...
void | SetTransparencyMode (OptimizerSettings.TransparencyMode transparency_mode)
| Set optimization related options for doing transparency. More...
void | SetUnembeddedFontSettings (UnembeddedFontSettings settings)
| Set optimization related settings for unembedding fonts. More...

## Detailed Description

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

See also
  Optimizer

## Member Enumeration Documentation

## ◆ CleanUpOptions

enum foxit.addon.optimization.OptimizerSettings.CleanUpOptions
| strong

Enumeration for cleaning up options.

Values of this enumeration can be used alone or in a combination.

Enumerator
e_CleanUpUseFlateForNonEncodedStream | Use Flate to encode streams that are not encoded.
e_CleanUpUseFlateInsteadOfLZW | In streams that use LZW encoding, use Flate instead.
e_CleanUpRemoveInvalidBookmarks | Remove invalid bookmarks.
e_CleanUpRemoveInvalidLinks | Remove invalid links.
e_CleanUpDiscardUnreferencedNamedDes | Discard unreferenced named destination.
e_CleanUpOptPageContent | Cleanup page content Change 0A,0D in the content stream to Spaces.

## ◆ DiscardObjectsOptions

enum foxit.addon.optimization.OptimizerSettings.DiscardObjectsOptions
| strong

Enumeration for discarding objects options.

Values of this enumeration can be used alone or in a combination.

Enumerator
e_DiscardObjectsFormActions | Discard all form submission, import and reset actions.
e_DiscardObjectsFlattenFormFields | Flatten form fields.
e_DiscardObjectsJavaScriptActions | Discard all JavaScript actions. Currently, it can not remove the javascript action in "OpenAction" of catalog.
e_DiscardObjectsEmbeddedPageThumbnails | Discard embedded page thumbnails.
e_DiscardObjectsEmbeddedPrintSettings | Discard embedded print settings.
e_DiscardObjectsBookmarks | Discard bookmarks.
e_DiscardObjectsAlternateImages | 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_DiscardObjectsDocumentTags | Discard document tags.
e_DiscardObjectsEmbeddedSearchIndex | Discard embedded search index.
e_DiscardObjectsDetectAndMergeImageFragment | Detect and merge image fragments.
e_DiscardObjectsSmoothlinestocurves | smooth lines to curves

## ◆ DiscardUserDataOptions

enum foxit.addon.optimization.OptimizerSettings.DiscardUserDataOptions
| strong

Enumeration for discarding user data options.

Values of this enumeration can be used alone or in a combination.

Enumerator
e_DiscardUserDataAllAnnotsFormsAndMultimedia | Discard all annotations, forms and multimedia.
e_DiscardUserDataExternalCrossReferences | Discard external cross references.
e_DiscardUserDataDocumentInfoAndMetaData | Discard document information and metadata.
e_DiscardUserDataFileAttchments | Discard file attachments.
e_DiscardUserDataPrivateDataOfOtherApp | Discard private data of other applications.
e_DiscardUserDataLayer | Discard hidden layer content and flatten visible layers.
e_DiscardUserAllData | discard tag user data

## ◆ OptimizerOptions

enum foxit.addon.optimization.OptimizerSettings.OptimizerOptions
| strong

Enumeration for optimizer options.

Values of this enumeration can be used alone or in a combination.

Enumerator
e_OptimizerCompressImages | Optimize PDF document by compressing images.
e_OptimizerCleanUp | Optimize PDF document by cleaning up.
e_OptimizerDiscardObjects | Optimize PDF document by discarding objects.
e_OptimizerUnembeddedFonts | Optimize PDF document by unembedding some embedded fonts.
e_OptimizerDiscardUserData | Optimize PDF document by discarding user data.
e_OptimizerTransparency | Optimize PDF document by doing transparency.

## ◆ TransparencyMode

enum foxit.addon.optimization.OptimizerSettings.TransparencyMode
| strong

Enumeration for transparency mode.

Values of this enumeration should be used alone.

Enumerator
e_TransparencyModeLowResolution | 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 | 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.
e_TransparencyModeHighResolution | 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.

## Constructor & Destructor Documentation

## ◆ OptimizerSettings() [1/2]

foxit.addon.optimization.OptimizerSettings.OptimizerSettings | ( |  | ) |
| inline

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]

foxit.addon.optimization.OptimizerSettings.OptimizerSettings | ( | OptimizerSettings | other | ) |
| inline

Constructor, with another optimizer settings object.

Parameters

  [in] | other | Another optimizer settings object.

## Member Function Documentation

## ◆ IsEmpty()

bool foxit.addon.optimization.OptimizerSettings.IsEmpty | ( |  | ) |
| inline

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 foxit.addon.optimization.OptimizerSettings.SetCleanUpOptions | ( | int | clean_up_options | ) |
| inline

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 foxit.addon.optimization.OptimizerSettings.OptimizerOptions.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 foxit.addon.optimization.OptimizerSettings.CleanUpOptions.e_CleanUpUseFlateForNonEncodedStream and this can be one or a combination of these values.

Returns
  None.

## ◆ SetColorGrayImageSettings()

void foxit.addon.optimization.OptimizerSettings.SetColorGrayImageSettings | ( | ImageSettings | settings | ) |
| inline

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 foxit.addon.optimization.OptimizerSettings.OptimizerOptions.e_OptimizerCompressImages is set by function OptimizerSettings.SetOptimizerOptions .

Parameters

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

Returns
  None.

## ◆ SetColorImageSettings()

void foxit.addon.optimization.OptimizerSettings.SetColorImageSettings | ( | ImageSettings | settings | ) |
| inline

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 foxit.addon.optimization.OptimizerSettings.OptimizerOptions.e_OptimizerCompressImages is set by function OptimizerSettings.SetOptimizerOptions .

Parameters

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

Returns
  None.

## ◆ SetDiscardObjectsOptions()

void foxit.addon.optimization.OptimizerSettings.SetDiscardObjectsOptions | ( | int | discard_objects_options | ) |
| inline

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 foxit.addon.optimization.OptimizerSettings.OptimizerOptions.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 foxit.addon.optimization.OptimizerSettings.DiscardObjectsOptions.e_DiscardObjectsFormActions and this can be one or a combination of these values.

Returns
  None.

## ◆ SetDiscardUserDataOptions()

void foxit.addon.optimization.OptimizerSettings.SetDiscardUserDataOptions | ( | int | discard_userdata_options | ) |
| inline

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 foxit.addon.optimization.OptimizerSettings.OptimizerOptions.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 foxit.addon.optimization.OptimizerSettings.DiscardUserDataOptions.e_DiscardUserDataAllAnnotsFormsAndMultimedia and this can be one or a combination of these values.

Returns
  None.

## ◆ SetGrayscaleImageSettings()

void foxit.addon.optimization.OptimizerSettings.SetGrayscaleImageSettings | ( | ImageSettings | settings | ) |
| inline

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 foxit.addon.optimization.OptimizerSettings.OptimizerOptions.e_OptimizerCompressImages is set by function OptimizerSettings.SetOptimizerOptions .

Parameters

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

Returns
  None.

## ◆ SetMonoImageSettings()

void foxit.addon.optimization.OptimizerSettings.SetMonoImageSettings | ( | MonoImageSettings | settings | ) |
| inline

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 foxit.addon.optimization.OptimizerSettings.OptimizerOptions.e_OptimizerCompressImages is set by function OptimizerSettings.SetOptimizerOptions .

Parameters

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

Returns
  None.

## ◆ SetOptimizerOptions()

void foxit.addon.optimization.OptimizerSettings.SetOptimizerOptions | ( | int | optimize_options | ) |
| inline

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 foxit.addon.optimization.OptimizerSettings.OptimizerOptions.e_OptimizerCompressImages and this can be one or a combination of these values.

Returns
  None.

## ◆ SetTransparencyMode()

void foxit.addon.optimization.OptimizerSettings.SetTransparencyMode | ( | OptimizerSettings.TransparencyMode | transparency_mode | ) |
| inline

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 foxit.addon.optimization.OptimizerSettings.TransparencyMode.e_TransparencyModeLowResolution default.

Parameters

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

Returns
  None.

## ◆ SetUnembeddedFontSettings()

void foxit.addon.optimization.OptimizerSettings.SetUnembeddedFontSettings | ( | UnembeddedFontSettings | settings | ) |
| inline

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 foxit.addon.optimization.OptimizerSettings.OptimizerOptions.e_OptimizerUnembeddedFonts is set by function OptimizerSettings.SetOptimizerOptions .

Parameters

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

Returns
  None.