Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
FSDK.OptimizerSettings Class Reference

## Public Member Functions
| constructor ()
| Constructor. More...
| IsEmpty ()
| Check whether current object is empty or not. More...
| SetCleanUpOptions (clean_up_options)
| Set optimization related options for cleaning up. More...
| SetColorGrayImageSettings (settings)
| Set optimization related settings for color/gray image. More...
| SetDiscardObjectsOptions (discard_objects_options)
| Set optimization related options for discarding objects. More...
| SetDiscardUserDataOptions (discard_userdata_options)
| Set optimization related options for discarding user data. More...
| SetMonoImageSettings (settings)
| Set optimization related settings for monochrome image. More...
| SetOptimizerOptions (optimize_options)
| Set options to decide which kind of optimizer setting will be used for optimizing PDF document. More...
| SetTransparencyMode (transparency_mode)
| Set optimization related options for doing transparency. More...
| SetUnembeddedFontSettings (settings)
| Set optimization related settings for unembedding fonts. More...

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

## Detailed Description

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

See also
  FSDK.Optimizer

## Member Function Documentation

## ◆ constructor()

FSDK.OptimizerSettings.constructor | ( |  | ) |

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.

## ◆ IsEmpty()

FSDK.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()

FSDK.OptimizerSettings.SetCleanUpOptions | ( | clean_up_options |  | ) |

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 FSDK.OptimizerSettings.e_OptimizerCleanUp is set by function FSDK.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 FSDK.OptimizerSettings.e_CleanUpUseFlateForNonEncodedStream and this can be one or a combination of these values.

Returns
  None.

## ◆ SetColorGrayImageSettings()

FSDK.OptimizerSettings.SetColorGrayImageSettings | ( | settings |  | ) |

Set optimization related settings for color/gray image.

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 FSDK.OptimizerSettings.SetColorImageSettings. Please refer to SetColorImageSettings related function in OptimizerSettings for more details. For setting grayscale image, please call function FSDK.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 FSDK.ImageSettings for default values.
ImageSettings set by this function is useful only when option value FSDK.OptimizerSettings.e_OptimizerCompressImages is set by function FSDK.OptimizerSettings.SetOptimizerOptions.

Parameters

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

Returns
  None.

## ◆ SetDiscardObjectsOptions()

FSDK.OptimizerSettings.SetDiscardObjectsOptions | ( | discard_objects_options |  | ) |

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 FSDK.OptimizerSettings.e_OptimizerDiscardObjects is set by function FSDK.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 FSDK.OptimizerSettings.e_DiscardObjectsFormActions and this can be one or a combination of these values.

Returns
  None.

## ◆ SetDiscardUserDataOptions()

FSDK.OptimizerSettings.SetDiscardUserDataOptions | ( | discard_userdata_options |  | ) |

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 FSDK.OptimizerSettings.e_OptimizerDiscardUserData is set by function FSDK.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 FSDK.OptimizerSettings.e_DiscardUserDataAllAnnotsFormsAndMultimedia and this can be one or a combination of these values.

Returns
  None.

## ◆ SetMonoImageSettings()

FSDK.OptimizerSettings.SetMonoImageSettings | ( | settings |  | ) |

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 FSDK.ImageSettings for detail values.
MonoImageSettings set by this function is useful only when option value FSDK.OptimizerSettings.e_OptimizerCompressImages is set by function FSDK.OptimizerSettings.SetOptimizerOptions.

Parameters

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

Returns
  None.

## ◆ SetOptimizerOptions()

FSDK.OptimizerSettings.SetOptimizerOptions | ( | optimize_options |  | ) |

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

Returns
  None.

## ◆ SetTransparencyMode()

FSDK.OptimizerSettings.SetTransparencyMode | ( | transparency_mode |  | ) |

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 FSOptimizerSettings.e_TransparencyModeLowResolution default.

Parameters

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

Returns
  None.

## ◆ SetUnembeddedFontSettings()

FSDK.OptimizerSettings.SetUnembeddedFontSettings | ( | settings |  | ) |

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 FSDK.OptimizerSettings.e_OptimizerUnembeddedFonts is set by function FSDK.OptimizerSettings.SetOptimizerOptions.

Parameters

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

Returns
  None.

## Member Data Documentation

## ◆ e_CleanUpUseFlateForNonEncodedStream

FSDK.OptimizerSettings.e_CleanUpUseFlateForNonEncodedStream
| static

Enumeration for cleaning up options.

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

Use Flate to encode streams that are not encoded.

## ◆ e_DiscardObjectsAlternateImages

FSDK.OptimizerSettings.e_DiscardObjectsAlternateImages
| 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_DiscardObjectsFormActions

FSDK.OptimizerSettings.e_DiscardObjectsFormActions
| static

Enumeration for discarding objects options.

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

Discard all form submission, import and reset actions.

## ◆ e_DiscardObjectsJavaScriptActions

FSDK.OptimizerSettings.e_DiscardObjectsJavaScriptActions
| static

Discard all JavaScript actions.

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

## ◆ e_DiscardUserDataAllAnnotsFormsAndMultimedia

FSDK.OptimizerSettings.e_DiscardUserDataAllAnnotsFormsAndMultimedia
| static

Enumeration for discarding user data options.

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

Discard all annotations, forms and multimedia.

## ◆ e_OptimizerCompressImages

FSDK.OptimizerSettings.e_OptimizerCompressImages
| static

Enumeration for optimizer options.

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

Optimize PDF document by compressing images.

## ◆ e_TransparencyModeHighResolution

FSDK.OptimizerSettings.e_TransparencyModeHighResolution
| 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

FSDK.OptimizerSettings.e_TransparencyModeLowResolution
| static

Enumeration for transparency mode.

Values of this enumeration should be used alone.

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

FSDK.OptimizerSettings.e_TransparencyModeMediumResolution
| 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.