Foxit PDF SDK
FoxitPDFSDKPython3.ImageSettings Class Reference
Inheritance diagram for FoxitPDFSDKPython3.ImageSettings:
FoxitPDFSDKPython3.Base

Public Member Functions

def ImageSettings ()
 Constructor.
More...
 
def ImageSettings (other)
 Constructor, with another image settings object.
More...
 
def IsEmpty ()
 Check whether current object is empty or not.
More...
 
def SetBackgroundDownScale (down_scale)
 Set the background downscale value for lossy compression modes, used for optimizing color images in a PDF document.
More...
 
def SetCompressionMode (mode)
 Set compression mode used for optimizing color/gray images in a PDF document.
More...
 
def SetForegroundDownScale (down_scale)
 Set the foreground downscale value for lossy compression modes, used for optimizing color images in a PDF document.
More...
 
def SetImageDPI (dpi)
 Set the DPI value as the target compressed value for compressing color/gray images in a PDF document.
More...
 
def SetImageDPILimit (dpi_limit)
 Set the lower limit DPI value for the color/gray image to decide if the image is to be compressed in a PDF document.
More...
 
def SetQuality (quality)
 Set the quality for lossy compression modes, used for optimizing color/gray images in a PDF document.
More...
 
def SetStretchMode (mode)
 Set stretch mode used for optimizing color/gray images in a PDF document.
More...
 
def SetTextSensitivity (text_sensitivity)
 Set the text sensitivity for lossy compression modes, used for optimizing color images in a PDF document.
More...
 

Static Public Attributes

 e_ImageCompressjpeg = _fsdk.ImageSettings_e_ImageCompressjpeg
 Compression mode: jpeg.

 
 e_ImageCompressjpeg2000 = _fsdk.ImageSettings_e_ImageCompressjpeg2000
 Compression mode: jpeg2000.

 
 e_ImageCompressQualityHigh = _fsdk.ImageSettings_e_ImageCompressQualityHigh
 Compression quality: High.

 
 e_ImageCompressQualityLow = _fsdk.ImageSettings_e_ImageCompressQualityLow
 Compression quality: Low.

 
 e_ImageCompressQualityMaximum = _fsdk.ImageSettings_e_ImageCompressQualityMaximum
 Compression quality: Maximum.

 
 e_ImageCompressQualityMedium = _fsdk.ImageSettings_e_ImageCompressQualityMedium
 Compression quality: Medium.

 
 e_ImageCompressRetain = _fsdk.ImageSettings_e_ImageCompressRetain
 Compression mode: retain, which means no compression.

 
 e_StretchBicubic = _fsdk.ImageSettings_e_StretchBicubic
 When this is set, that means to do bicubic interpolation for zooming.

 
 e_StretchDownsample = _fsdk.ImageSettings_e_StretchDownsample
 When this is set, that means not to do halftone for shrinking or rotating.

 
 e_StretchInterpol = _fsdk.ImageSettings_e_StretchInterpol
 When this is set, that means to do interpolation for zooming.

 
 e_StretchNoSmooth = _fsdk.ImageSettings_e_StretchNoSmooth
 When this is set, that means not to do any interpolation for stretching.

 
 e_StretchOff = _fsdk.ImageSettings_e_StretchOff
 When this is set, that means to 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]

def FoxitPDFSDKPython3.ImageSettings.ImageSettings ( )

Constructor.

This constructor is to construct a color/gray image settings object with default setting options. User can also call "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]

def FoxitPDFSDKPython3.ImageSettings.ImageSettings (   other)

Constructor, with another image settings object.

Parameters
[in]otherAnother image settings object.

Member Function Documentation

◆ IsEmpty()

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

◆ SetBackgroundDownScale()

def FoxitPDFSDKPython3.ImageSettings.SetBackgroundDownScale (   down_scale)

Set the background downscale value for lossy compression modes, used for optimizing color images in a PDF document.

This function is used to reduce the resolution of the background image.

Parameters
[in]down_scaleBackground downscale value for lossy compression modes. It should be above 0. If the value is 1, the background resolution is not reduced. If the value is larger than 1, the higher the value, the lower the background resolution. If this function is not called to set this option, that means to use 3 as the default value of this option.
Returns
None.

◆ SetCompressionMode()

def FoxitPDFSDKPython3.ImageSettings.SetCompressionMode (   mode)

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 FoxitPDFSDKPython3.ImageSettings.e_ImageCompressjpeg as the default value of this option.

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

◆ SetForegroundDownScale()

def FoxitPDFSDKPython3.ImageSettings.SetForegroundDownScale (   down_scale)

Set the foreground downscale value for lossy compression modes, used for optimizing color images in a PDF document.

This function is used to reduce the resolution of the foreground image.

Parameters
[in]down_scaleForeground downscale value for lossy compression modes. It should be above 0. If the value is 1, the foreground resolution is not reduced. If the value is larger than 1, the higher the value, the lower the foreground resolution. If this function is not called to set this option, that means to use 3 as the default value of this option.
Returns
None.

◆ SetImageDPI()

def FoxitPDFSDKPython3.ImageSettings.SetImageDPI (   dpi)

Set the DPI value as the target compressed value for compressing color/gray images in a PDF document.

When an image can be compressed, the resolution of this image will be compressed to the DPI value set by current function.
For a newly constructed object, if this function is not called to set option, that means to use 150 as the default value of this option.

Parameters
[in]dpiDPI value which is set to be the target compressed DPI value.
Returns
None.

◆ SetImageDPILimit()

def FoxitPDFSDKPython3.ImageSettings.SetImageDPILimit (   dpi_limit)

Set the lower limit DPI value for the color/gray image to decide if the image is to be compressed in a PDF document.

If the resolution of an image in the PDF document is above the lower limit DPI value, this image will be compressed to the target compressed DPI value which is set by function FoxitPDFSDKPython3.ImageSettings.SetImageDPI .
For a newly constructed object, if this function is not called to set option, that means a DPI value (which is 1.5 times of target compressed DPI value) will be used as the default value of this option.

Parameters
[in]dpi_limitDPI value as the lower limit. This value should be a positive number. Suggested range: bigger than target compressed DPI value (set by function FoxitPDFSDKPython3.ImageSettings.SetImageDPI ) and the maximum value is 10 times of target compressed DPI value.
If input value is not bigger than the target compressed DPI value, a DPI value which is one more than the target compressed DPI value will be used instead.
If input value is bigger than the maximum value, the maximum value value will be used instead.
Returns
None.

◆ SetQuality()

def FoxitPDFSDKPython3.ImageSettings.SetQuality (   quality)

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 FoxitPDFSDKPython3.ImageSettings.e_ImageCompressQualityMinimum as the default value of this option.

Parameters
[in]qualityQuality value for lossy compression modes. Please refer to values starting from FoxitPDFSDKPython3.ImageSettings.e_ImageCompressQualityMinimum and this should be one of these values.
Returns
None.

◆ SetStretchMode()

def FoxitPDFSDKPython3.ImageSettings.SetStretchMode (   mode)

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 FoxitPDFSDKPython3.ImageSettings.e_StretchBicubic as the default value of this option.

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

◆ SetTextSensitivity()

def FoxitPDFSDKPython3.ImageSettings.SetTextSensitivity (   text_sensitivity)

Set the text sensitivity for lossy compression modes, used for optimizing color images in a PDF document.

This function affects the segmentation into foreground (usually text) and background. if this function is not called to set this option, that means to use 60 as the default value of this option.

Parameters
[in]text_sensitivityThe value of text sensitivity. A higher sensitivity value results in more content represented in the foreground. The value is especially important in case of documents with low contrast and documents with patterns, images or color in background. Instead, the effect on simple text documents with high contrast, clear bright background and sharp dark symbols is low. Valid values: from 0 to 100.
Returns
None.