Foxit PDF SDK

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

## Public Member Functions
def | CloneBitmap (graphics_objects)
def | CloneBitmap (page, graphics_objects)
| Clone the bitmap from current image graphics object. More...
def | GetColorSpace ()
| Get color space. More...
def | GetMask ()
| Get the PDF object that represents the mask of current image graphics object. More...
def | GetStream ()
| Get image stream. More...
def | IsImageMask ()
| Check if current image object is treated as mask. More...
def | SetBitmap (bitmap, mask)
| Set a bitmap to current image graphics object. More...
def | SetImage (image, frame_index)
| Set one frame of an image to current image graphics object. More...
Public Member Functions inherited from FoxitPDFSDKPython3.GraphicsObject
def | AddClipPath (path, fill_mode)
| Add a path for clipping. More...
def | AddClipTextObject (textobject)
| Add text object for clipping. More...
def | ClearClips ()
| Clear all clips. More...
def | Clone ()
| Clone a new graphics object. More...
def | GetBlendMode ()
| Get the blend mode for transparent imaging model. More...
def | GetClipPath (index)
| Get a path clip by index. More...
def | GetClipPathCount ()
| Get the count of path clip. More...
def | GetClipPathFillMode (index)
| Get the fill mode of a path clip by index. More...
def | GetClipRect ()
| Get clip rectangle. More...
def | GetClipTextObject (index)
| Get the text object of a text clip by index. More...
def | GetClipTextObjectCount ()
| Get the count of text clip. More...
def | GetColorState ()
| Get color state. More...
def | GetFillColor ()
| Get the fill color. More...
def | GetFillOpacity ()
| Get the opacity value for painting operations other than stroking. More...
def | GetFormXObject ()
| Get the form XObject graphics object if current graphics object represents a form XObject object. More...
def | GetGraphState ()
| Get graph state. More...
def | GetImageObject ()
| Get the image graphics object if current graphics object represents an image object. More...
def | GetLayers (layer_tree)
| Get all the layers which are associated with current graphics object. More...
def | GetMarkedContent ()
| Get marked content object. More...
def | GetMatrix ()
| Get matrix. More...
def | GetPathObject ()
| Get the path graphics object if current graphics object represents a path object. More...
def | GetRect ()
| Get the rectangle of current graphics object. More...
def | GetShadingObject ()
| Get the shading graphics object if current graphics object represents a shading object. More...
def | GetStrokeColor ()
| Get the stroke color. More...
def | GetStrokeOpacity ()
| Get opacity value for stroke painting operations for paths and glyph outlines. More...
def | GetTextObject ()
| Get the text graphics object if current graphics object represents a text object. More...
def | GetType ()
| Get the type of current graphics object. More...
def | HasTransparency ()
| Check whether current graphics object has transparency or not. More...
def | Release ()
| Release a cloned or newly created PDF graphics object which has not been inserted into any PDF page or other object. More...
def | RemoveClipPath (index)
| Remove a path clip by index. More...
def | RemoveClipTextObject (index)
| Remove a text clip by index for clipping. More...
def | Rotate (angle)
| Rotate current graphics object from current state with specified angle degree in clockwise. More...
def | SetBlendMode (blend_mode)
| Set the blend mode for transparent imaging model. More...
def | SetClipRect (clip_rect)
| Set clip rectangle. More...
def | SetColorState (color_state)
| Set color state. More...
def | SetFillColor (color)
| Set the fill color. More...
def | SetFillOpacity (opacity)
| Set the opacity value for painting operations other than stroking. More...
def | SetGraphState (graph_state)
| Set graph state. More...
def | SetMatrix (matrix)
| Set matrix. More...
def | SetStrokeColor (color)
| Set the stroke color. More...
def | SetStrokeOpacity (opacity)
| Set opacity value for stroke painting operations for paths and glyph outlines. More...
def | Transform (matrix, need_transform_clippath)
| Transform current graphics object. More...

## Static Public Member Functions
def | Create (document)
| Create a new image graphics object. More...
def | CreateFromType3TextObject (page, text_obj)
| Create an image graphics object from a type3 text object. More...

## Additional Inherited Members
Static Public Attributes inherited from FoxitPDFSDKPython3.GraphicsObject
| e_BlendColor = _fsdk.GraphicsObject_e_BlendColor
| Creates a color with the hue and saturation of the source color, and the luminosity of the backdrop color. More...
| e_BlendColorBurn = _fsdk.GraphicsObject_e_BlendColorBurn
| Darkens backdrop color to reflect the source color. More...
| e_BlendColorDodge = _fsdk.GraphicsObject_e_BlendColorDodge
| Brightens backdrop color to reflect source colors. More...
| e_BlendDarken = _fsdk.GraphicsObject_e_BlendDarken
| Select darker one of backdrop and source colors. More...
| e_BlendDifference = _fsdk.GraphicsObject_e_BlendDifference
| Subtracts the darker of the two constituent colors from lighter colors. More...
| e_BlendExclusion = _fsdk.GraphicsObject_e_BlendExclusion
| Creates a color with the hue of the source color, and the saturation and luminosity of the backdrop color. More...
| e_BlendHardlight = _fsdk.GraphicsObject_e_BlendHardlight
| Multiply or screens colors, depending on source color value. More...
| e_BlendHue = _fsdk.GraphicsObject_e_BlendHue
| Creates a color with the hue of the source color, and the saturation and luminosity of the backdrop color. More...
| e_BlendLighten = _fsdk.GraphicsObject_e_BlendLighten
| Select lighter one of backdrop and source colors. More...
| e_BlendLuminosity = _fsdk.GraphicsObject_e_BlendLuminosity
| Creates a color with the luminosity of the source color, and the hue and saturation of the backdrop color. More...
| e_BlendMultiply = _fsdk.GraphicsObject_e_BlendMultiply
| Multiply backdrop by source color values. More...
| e_BlendNormal = _fsdk.GraphicsObject_e_BlendNormal
| Selecting source color and ignoring backdrop color. More...
| e_BlendOverlay = _fsdk.GraphicsObject_e_BlendOverlay
| Multiply or screens colors, depending on backdrop color value. More...
| e_BlendSaturation = _fsdk.GraphicsObject_e_BlendSaturation
| Creates a color with the saturation of the source color, and the hue and luminosity of the backdrop color. More...
| e_BlendScreen = _fsdk.GraphicsObject_e_BlendScreen
| Multiply complements of backdrop by source color values, and then complement the result. More...
| e_BlendSoftlight = _fsdk.GraphicsObject_e_BlendSoftlight
| Darkens or lightens colors, depending on source color value. More...
| e_TypeAll = _fsdk.GraphicsObject_e_TypeAll
| Represents all graphics object types, only used as filter.
| e_TypeEmptyMarkedContent = _fsdk.GraphicsObject_e_TypeEmptyMarkedContent
| Empty marked-content object.
| e_TypeFormXObject = _fsdk.GraphicsObject_e_TypeFormXObject
| Form XObject graphics object.
| e_TypeImage = _fsdk.GraphicsObject_e_TypeImage
| Image graphics object.
| e_TypeInlines = _fsdk.GraphicsObject_e_TypeInlines
| Inline graphics object.
| e_TypePath = _fsdk.GraphicsObject_e_TypePath
| Path graphics object.
| e_TypeShading = _fsdk.GraphicsObject_e_TypeShading
| Shading graphics object.
| e_TypeText = _fsdk.GraphicsObject_e_TypeText
| Text graphics object.

## Detailed Description

Image graphics object is a kind of PDF graphics object, so class ImageObject is derived from class GraphicsObject . It offers functions to get/set image graphics object's data.
To create a new image graphics object, please use function FoxitPDFSDKPython3.ImageObject.Create and then use setting functions to set information to the new image graphics object.

See also
  GraphicsObject

## Member Function Documentation

## ◆ CloneBitmap() [1/2]

def FoxitPDFSDKPython3.ImageObject.CloneBitmap | ( |  | graphics_objects | ) |

Deprecated:
  This function is deprecated. Use function FoxitPDFSDKPython3.ImageObject.CloneBitmap with two parameters instead.

Currently, the bitmap can be cloned from image graphics object only when the bitmap format is one of following formats:
FoxitPDFSDKPython3.Bitmap.e_DIB8bppMask , FoxitPDFSDKPython3.Bitmap.e_DIB8bpp , FoxitPDFSDKPython3.Bitmap.e_DIBRgb , FoxitPDFSDKPython3.Bitmap.e_DIBRgb32 , FoxitPDFSDKPython3.Bitmap.e_DIBArgb , FoxitPDFSDKPython3.Bitmap.e_DIBCmyk .
If the return value of function FoxitPDFSDKPython3.Bitmap.IsEmpty for the returned bitmap object is true, that means the DIB format of the bitmap is unsupported.

Parameters

  [in] | graphics_objects | A valid FoxitPDFSDKPython3.GraphicsObjects object. Please ensure that current image graphics object just belongs to this FoxitPDFSDKPython3.GraphicsObjects object (it may be a PDF page).

Returns
  The new cloned bitmap object. If the return value of function FoxitPDFSDKPython3.Bitmap.IsEmpty for the returned bitmap object is true, that means the DIB format of the bitmap is unsupported.

## ◆ CloneBitmap() [2/2]

def FoxitPDFSDKPython3.ImageObject.CloneBitmap | ( |  | page,
|  |  | graphics_objects
| ) |  |

Clone the bitmap from current image graphics object.

Currently, the bitmap can be cloned from image graphics object only when the bitmap format is one of following formats:
FoxitPDFSDKPython3.Bitmap.e_DIB8bppMask , FoxitPDFSDKPython3.Bitmap.e_DIB8bpp , FoxitPDFSDKPython3.Bitmap.e_DIBRgb , FoxitPDFSDKPython3.Bitmap.e_DIBRgb32 , FoxitPDFSDKPython3.Bitmap.e_DIBArgb , FoxitPDFSDKPython3.Bitmap.e_DIBCmyk .
If the return value of function FoxitPDFSDKPython3.Bitmap.IsEmpty for the returned bitmap object is true, that means the DIB format of the bitmap is unsupported.

Parameters

  [in] | page | A valid PDF page object. Please ensure that current image graphics object just belongs to this page.
  [in] | graphics_objects | A valid FoxitPDFSDKPython3.GraphicsObjects object. Please ensure that current image graphics object just belongs to this FoxitPDFSDKPython3.GraphicsObjects object (it may be a PDF page).

Returns
  The new cloned bitmap object. If the return value of function FoxitPDFSDKPython3.Bitmap.IsEmpty for the returned bitmap object is true, that means the DIB format of the bitmap is unsupported.

## ◆ Create()

FoxitPDFSDKPython3.ImageObject.Create | ( |  | document | ) |
| static

Create a new image graphics object.

The newly created image graphics object does not have any data yet. Then, setting functions can be called to set data to the new image graphics object. If the newly created image graphics object will not inserted to any page or other objects, please remember to call function FoxitPDFSDKPython3.GraphicsObject.Release to release it when no use.

Parameters

  [in] | document | A valid PDF document object. The new image graphics object should be inserted to one page of this PDF document then.

Returns
  A new image object. If there is any error, this function will return null.

## ◆ CreateFromType3TextObject()

FoxitPDFSDKPython3.ImageObject.CreateFromType3TextObject | ( |  | page,
|  |  | text_obj
| ) |  |
| static

Create an image graphics object from a type3 text object.

If the newly created image graphics object will not inserted to any page or other objects, please remember to call function FoxitPDFSDKPython3.GraphicsObject.Release to release it when no use.

Parameters

  [in] | page | A valid PDF page object.
  [in] | text_obj | A valid text object. This text object should be a type3 text object.

Returns
  A new image object. If there is any error, this function will return null.

## ◆ GetColorSpace()

def FoxitPDFSDKPython3.ImageObject.GetColorSpace | ( |  | ) |

Get color space.

Returns
  Color space. Please refer to values starting from FoxitPDFSDKPython3.e_ColorSpaceDeviceGray and this would be one of these values.

## ◆ GetMask()

def FoxitPDFSDKPython3.ImageObject.GetMask | ( |  | ) |

Get the PDF object that represents the mask of current image graphics object.

The mask can be either a PDF dictionary or a PDF array:

- A PDF dictionary represents an image mask to be applied to this image.
- A PDF array represents a range of colors to be applied to it as a color key mask.

Please refer to Section 4.8.4 "Image Dictionaries" in <PDF Reference 1.7> for more details.

Returns
  A PDF object that represents the mask. If FoxitPDFSDKPython3.ImageObject.IsImageMask returns true, this function will return null.

## ◆ GetStream()

def FoxitPDFSDKPython3.ImageObject.GetStream | ( |  | ) |

Get image stream.

Returns
  A FoxitPDFSDKPython3.PDFStream that represents the image stream. If there is any error, this function will return null.

## ◆ IsImageMask()

def FoxitPDFSDKPython3.ImageObject.IsImageMask | ( |  | ) |

Check if current image object is treated as mask.

Returns
  true means current object is treated as mask, while false means not.

## ◆ SetBitmap()

def FoxitPDFSDKPython3.ImageObject.SetBitmap | ( |  | bitmap,
|  |  | mask
| ) |  |

Set a bitmap to current image graphics object.

Parameters

  [in] | bitmap | A valid bitmap object to be set to current image.
  [in] | mask | Mask bitmap. Default value: A bitmap object by default constructor and not set any value, which means no mask is used. If this is valid, its format should be FoxitPDFSDKPython3.Bitmap.e_DIB8bppMask . This is useful only when parameter bitmap does not have an alpha channel.

Returns
  None

Note
  When this function succeeds, function FoxitPDFSDKPython3.GraphicsObjects.GenerateContent should be called. Please refer to function FoxitPDFSDKPython3.GraphicsObjects.GenerateContent for more details.

## ◆ SetImage()

def FoxitPDFSDKPython3.ImageObject.SetImage | ( |  | image,
|  |  | frame_index
| ) |  |

Set one frame of an image to current image graphics object.

Input image may contain multiple frames, and only one frame of the image can be set to current image graphics object.

Parameters

  [in] | image | A valid image object. This image should contain at least one frame and the image type should not be FoxitPDFSDKPython3.Image.e_Unknown .
  [in] | frame_index | Frame index used to decide which frame of parameter image is to be set. Valid range: from 0 to (count-1). count is returned by function FoxitPDFSDKPython3.Image.GetFrameCount .

Returns
  None

Note
  When this function succeeds, function FoxitPDFSDKPython3.GraphicsObjects.GenerateContent should be called. Please refer to function FoxitPDFSDKPython3.GraphicsObjects.GenerateContent for more details.