Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
FoxitPDFSDKPython3.OptimizerSettings Class Reference
Inheritance diagram for FoxitPDFSDKPython3.OptimizerSettings:

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

## Static Public Attributes
| e_CleanUpDiscardUnreferencedNamedDes = _fsdk.OptimizerSettings_e_CleanUpDiscardUnreferencedNamedDes
| Discard unreferenced named destination.
| e_CleanUpOptPageContent = _fsdk.OptimizerSettings_e_CleanUpOptPageContent
| Cleanup page content Change 0A,0D in the content stream to Spaces.
| e_CleanUpRemoveInvalidBookmarks = _fsdk.OptimizerSettings_e_CleanUpRemoveInvalidBookmarks
| Remove invalid bookmarks.
| e_CleanUpRemoveInvalidLinks = _fsdk.OptimizerSettings_e_CleanUpRemoveInvalidLinks
| Remove invalid links.
| e_CleanUpUseFlateForNonEncodedStream = _fsdk.OptimizerSettings_e_CleanUpUseFlateForNonEncodedStream
| Use Flate to encode streams that are not encoded.
| e_CleanUpUseFlateInsteadOfLZW = _fsdk.OptimizerSettings_e_CleanUpUseFlateInsteadOfLZW
| In streams that use LZW encoding, use Flate instead.
| e_DiscardObjectsAlternateImages = _fsdk.OptimizerSettings_e_DiscardObjectsAlternateImages
| Discard all alternate images. More...
| e_DiscardObjectsBookmarks = _fsdk.OptimizerSettings_e_DiscardObjectsBookmarks
| Discard bookmarks.
| e_DiscardObjectsDetectAndMergeImageFragment = _fsdk.OptimizerSettings_e_DiscardObjectsDetectAndMergeImageFragment
| Detect and merge image fragments.
| e_DiscardObjectsDocumentTags = _fsdk.OptimizerSettings_e_DiscardObjectsDocumentTags
| Discard document tags.
| e_DiscardObjectsEmbeddedPageThumbnails = _fsdk.OptimizerSettings_e_DiscardObjectsEmbeddedPageThumbnails
| Discard embedded page thumbnails.
| e_DiscardObjectsEmbeddedPrintSettings = _fsdk.OptimizerSettings_e_DiscardObjectsEmbeddedPrintSettings
| Discard embedded print settings.
| e_DiscardObjectsEmbeddedSearchIndex = _fsdk.OptimizerSettings_e_DiscardObjectsEmbeddedSearchIndex
| Discard embedded search index.
| e_DiscardObjectsFlattenFormFields = _fsdk.OptimizerSettings_e_DiscardObjectsFlattenFormFields
| Flatten form fields.
| e_DiscardObjectsFormActions = _fsdk.OptimizerSettings_e_DiscardObjectsFormActions
| Discard all form submission, import and reset actions.
| e_DiscardObjectsJavaScriptActions = _fsdk.OptimizerSettings_e_DiscardObjectsJavaScriptActions
| Discard all JavaScript actions. More...
| e_DiscardObjectsSmoothlinestocurves = _fsdk.OptimizerSettings_e_DiscardObjectsSmoothlinestocurves
| smooth lines to curves
| e_DiscardUserAllData = _fsdk.OptimizerSettings_e_DiscardUserAllData
| discard tag user data
| e_DiscardUserDataAllAnnotsFormsAndMultimedia = _fsdk.OptimizerSettings_e_DiscardUserDataAllAnnotsFormsAndMultimedia
| Discard all annotations, forms and multimedia.
| e_DiscardUserDataDocumentInfoAndMetaData = _fsdk.OptimizerSettings_e_DiscardUserDataDocumentInfoAndMetaData
| Discard document information and metadata.
| e_DiscardUserDataExternalCrossReferences = _fsdk.OptimizerSettings_e_DiscardUserDataExternalCrossReferences
| Discard external cross references.
| e_DiscardUserDataFileAttchments = _fsdk.OptimizerSettings_e_DiscardUserDataFileAttchments
| Discard file attachments.
| e_DiscardUserDataLayer = _fsdk.OptimizerSettings_e_DiscardUserDataLayer
| Discard hidden layer content and flatten visible layers.
| e_DiscardUserDataPrivateDataOfOtherApp = _fsdk.OptimizerSettings_e_DiscardUserDataPrivateDataOfOtherApp
| Discard private data of other applications.
| e_OptimizerCleanUp = _fsdk.OptimizerSettings_e_OptimizerCleanUp
| Optimize PDF document by cleaning up.
| e_OptimizerCompressImages = _fsdk.OptimizerSettings_e_OptimizerCompressImages
| Optimize PDF document by compressing images.
| e_OptimizerDiscardObjects = _fsdk.OptimizerSettings_e_OptimizerDiscardObjects
| Optimize PDF document by discarding objects.
| e_OptimizerDiscardUserData = _fsdk.OptimizerSettings_e_OptimizerDiscardUserData
| Optimize PDF document by discarding user data.
| e_OptimizerTransparency = _fsdk.OptimizerSettings_e_OptimizerTransparency
| Optimize PDF document by doing transparency.
| e_OptimizerUnembeddedFonts = _fsdk.OptimizerSettings_e_OptimizerUnembeddedFonts
| Optimize PDF document by unembedding some embedded fonts.
| e_TransparencyModeHighResolution = _fsdk.OptimizerSettings_e_TransparencyModeHighResolution
| Transparency mode: high resolution. More...
| e_TransparencyModeLowResolution = _fsdk.OptimizerSettings_e_TransparencyModeLowResolution
| Transparency mode: low resolution. More...
| e_TransparencyModeMediumResolution = _fsdk.OptimizerSettings_e_TransparencyModeMediumResolution
| 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]

def FoxitPDFSDKPython3.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]

def FoxitPDFSDKPython3.OptimizerSettings.OptimizerSettings | ( |  | other | ) |

Constructor, with another optimizer settings object.

Parameters

  [in] | other | Another optimizer settings object.

## Member Function Documentation

## ◆ IsEmpty()

def FoxitPDFSDKPython3.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()

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

Returns
  None.

## ◆ SetColorGrayImageSettings()

def FoxitPDFSDKPython3.OptimizerSettings.SetColorGrayImageSettings | ( |  | 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 FoxitPDFSDKPython3.OptimizerSettings.SetColorImageSettings . Please refer to SetColorImageSettings related function in OptimizerSettings for more details. For setting grayscale image, please call function FoxitPDFSDKPython3.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 FoxitPDFSDKPython3.OptimizerSettings.e_OptimizerCompressImages is set by function FoxitPDFSDKPython3.OptimizerSettings.SetOptimizerOptions .

Parameters

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

Returns
  None.

## ◆ SetColorImageSettings()

def FoxitPDFSDKPython3.OptimizerSettings.SetColorImageSettings | ( |  | settings | ) |

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 FoxitPDFSDKPython3.OptimizerSettings.e_OptimizerCompressImages is set by function FoxitPDFSDKPython3.OptimizerSettings.SetOptimizerOptions .

Parameters

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

Returns
  None.

## ◆ SetDiscardObjectsOptions()

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

Returns
  None.

## ◆ SetDiscardUserDataOptions()

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

Returns
  None.

## ◆ SetGrayscaleImageSettings()

def FoxitPDFSDKPython3.OptimizerSettings.SetGrayscaleImageSettings | ( |  | settings | ) |

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 FoxitPDFSDKPython3.OptimizerSettings.e_OptimizerCompressImages is set by function FoxitPDFSDKPython3.OptimizerSettings.SetOptimizerOptions .

Parameters

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

Returns
  None.

## ◆ SetMonoImageSettings()

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

Parameters

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

Returns
  None.

## ◆ SetOptimizerOptions()

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

Returns
  None.

## ◆ SetTransparencyMode()

def FoxitPDFSDKPython3.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 FoxitPDFSDKPython3.OptimizerSettings.e_TransparencyModeLowResolution default.

Parameters

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

Returns
  None.

## ◆ SetUnembeddedFontSettings()

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

Parameters

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

Returns
  None.

## Member Data Documentation

## ◆ e_DiscardObjectsAlternateImages

FoxitPDFSDKPython3.OptimizerSettings.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_DiscardObjectsJavaScriptActions

FoxitPDFSDKPython3.OptimizerSettings.e_DiscardObjectsJavaScriptActions = _fsdk.OptimizerSettings_e_DiscardObjectsJavaScriptActions
| static

Discard all JavaScript actions.

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

## ◆ e_TransparencyModeHighResolution

FoxitPDFSDKPython3.OptimizerSettings.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

FoxitPDFSDKPython3.OptimizerSettings.e_TransparencyModeLowResolution = _fsdk.OptimizerSettings_e_TransparencyModeLowResolution
| 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

FoxitPDFSDKPython3.OptimizerSettings.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.