|
Foxit PDF SDK
|
Public Member Functions | |
| 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 (a, interface) |
| 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... | |
Content of a PDF page usually consists of a sequence of graphics objects. Each graphics object contains its state information, data and instructions for rendering.
Class GraphicsObject is the base class for all types of PDF graphics objects. It offers the base functions to get/set graphics object's common properties. For concrete graphics object types, please refer to derived classes.
To get or insert/remove a graphics object, please refer to class fsdk.GraphicsObjects .
If any change is done to a PDF graphics object, please remember to call function fsdk.GraphicsObjects.GenerateContent for fsdk.GraphicsObjects object (to which current graphics object belongs). Please refer to comment of function fsdk.GraphicsObjects.GenerateContent for more details.
| def fsdk.GraphicsObject.AddClipPath | ( | path, | |
| fill_mode | |||
| ) |
Add a path for clipping.
| [in] | path | Path data to be added to current graphics object. |
| [in] | fill_mode | Fill mode for the input path. Please refer to values starting from fsdk.E_FillModeNone and this should be one of these values. |
| def fsdk.GraphicsObject.AddClipTextObject | ( | textobject | ) |
Add text object for clipping.
| [in] | textobject | Text object to be added for clipping. |
| def fsdk.GraphicsObject.ClearClips | ( | ) |
Clear all clips.
| def fsdk.GraphicsObject.Clone | ( | a, | |
| interface | |||
| ) |
Clone a new graphics object.
Newly cloned graphics object is related to the same page with current graphics object by default. Newly cloned graphics object can only be used inside the PDF file which contains current graphics object. If the cloned graphics object is not inserted to any PDF page or other object, please remember to call function fsdk.GraphicsObject.Release to release it when not use it any more.
Newly cloned graphics object is related to the page which is dest_graphicsobjects belong to. Newly cloned graphics object can be used inside or outside the PDF file which contains current graphics object. If the cloned graphics object is not inserted to any PDF page or other object, please remember to call function fsdk.GraphicsObject.Release to release it when not use it any more.
| [in] | src_graphicsobjects | A GraphicsObjects object which contains current graphics object. |
| [in] | dest_graphicsobjects | A GraphicsObjects object which will contain the cloned graphics object. This can belong to another page in current document or a page in another document. |
| def fsdk.GraphicsObject.GetBlendMode | ( | ) |
Get the blend mode for transparent imaging model.
| def fsdk.GraphicsObject.GetClipPath | ( | index | ) |
Get a path clip by index.
| [in] | index | Path clip index. Valid range: from 0 to (count-1). count is returned by function fsdk.GraphicsObject.GetClipPath . |
| def fsdk.GraphicsObject.GetClipPathCount | ( | ) |
Get the count of path clip.
| def fsdk.GraphicsObject.GetClipPathFillMode | ( | index | ) |
Get the fill mode of a path clip by index.
| [in] | index | Path clip index. Valid range: from 0 to (count-1). count is returned by function fsdk.GraphicsObject.GetClipPath . |
| def fsdk.GraphicsObject.GetClipRect | ( | ) |
Get clip rectangle.
| def fsdk.GraphicsObject.GetClipTextObject | ( | index | ) |
Get the text object of a text clip by index.
| [in] | index | Text clip index. Valid range: from 0 to (count-1). count is returned by function fsdk.GraphicsObject.GetClipTextObjectCount . |
| def fsdk.GraphicsObject.GetClipTextObjectCount | ( | ) |
Get the count of text clip.
| def fsdk.GraphicsObject.GetColorState | ( | ) |
Get color state.
Text graphics object, path graphics object, and form XObject graphics object can have color state.
| def fsdk.GraphicsObject.GetFillColor | ( | ) |
Get the fill color.
Text graphics object, path graphics object, and form XObject graphics object can have this property. Function fsdk.GraphicsObject.GetColorState can be used to get fille color in other color space, like CMYK color space.
| def fsdk.GraphicsObject.GetFillOpacity | ( | ) |
Get the opacity value for painting operations other than stroking.
| def fsdk.GraphicsObject.GetFormXObject | ( | ) |
Get the form XObject graphics object if current graphics object represents a form XObject object.
| def fsdk.GraphicsObject.GetGraphState | ( | ) |
Get graph state.
Form XObjet graphics object, path graphics object and text graphics object can have this property.
| def fsdk.GraphicsObject.GetImageObject | ( | ) |
Get the image graphics object if current graphics object represents an image object.
| def fsdk.GraphicsObject.GetLayers | ( | layer_tree | ) |
Get all the layers which are associated with current graphics object.
| [in] | layer_tree | A valid layer tree. All the layer nodes in this layer tree will be enumerated in order to find which are associated with current graphics object. |
| def fsdk.GraphicsObject.GetMarkedContent | ( | ) |
Get marked content object.
| def fsdk.GraphicsObject.GetMatrix | ( | ) |
Get matrix.
| def fsdk.GraphicsObject.GetPathObject | ( | ) |
Get the path graphics object if current graphics object represents a path object.
| def fsdk.GraphicsObject.GetRect | ( | ) |
Get the rectangle of current graphics object.
| def fsdk.GraphicsObject.GetShadingObject | ( | ) |
Get the shading graphics object if current graphics object represents a shading object.
| def fsdk.GraphicsObject.GetStrokeColor | ( | ) |
Get the stroke color.
Text graphics object, path graphics object, and form XObject graphics object can have this property.
Function fsdk.GraphicsObject.GetColorState can be used to get stroke color in other color space, like CMYK color space.
| def fsdk.GraphicsObject.GetStrokeOpacity | ( | ) |
Get opacity value for stroke painting operations for paths and glyph outlines.
| def fsdk.GraphicsObject.GetTextObject | ( | ) |
Get the text graphics object if current graphics object represents a text object.
| def fsdk.GraphicsObject.GetType | ( | ) |
Get the type of current graphics object.
| def fsdk.GraphicsObject.HasTransparency | ( | ) |
Check whether current graphics object has transparency or not.
| def fsdk.GraphicsObject.Release | ( | ) |
Release a cloned or newly created PDF graphics object which has not been inserted into any PDF page or other object.
| def fsdk.GraphicsObject.RemoveClipPath | ( | index | ) |
Remove a path clip by index.
| [in] | index | Path clip index. Valid range: from 0 to (count-1). count is returned by function fsdk.GraphicsObject.GetClipPath . |
| def fsdk.GraphicsObject.RemoveClipTextObject | ( | index | ) |
Remove a text clip by index for clipping.
| [in] | index | Text clip index. Valid range: from 0 to (count-1). count is returned by function fsdk.GraphicsObject.GetClipTextObjectCount . |
| def fsdk.GraphicsObject.Rotate | ( | angle | ) |
Rotate current graphics object from current state with specified angle degree in clockwise.
| [in] | angle | Angle degree value, which is used to rotate current graphics object from current state in clockwise. Value range: from 0 to 360. Specially, if the input value is 0 or 360 (which means not to rotate current graphics object), current function will do nothing. |
| def fsdk.GraphicsObject.SetBlendMode | ( | blend_mode | ) |
Set the blend mode for transparent imaging model.
| [in] | blend_mode | New blend mode. Please refer to values starting from fsdk.GraphicsObjectE_BlendNormal and this should be one of these values. |
| def fsdk.GraphicsObject.SetClipRect | ( | clip_rect | ) |
Set clip rectangle.
New clip rectangle will be set with fill mode fsdk.E_FillModeWinding by default.
| [in] | clip_rect | New clip rectangle. |
| def fsdk.GraphicsObject.SetColorState | ( | color_state | ) |
Set color state.
Text graphics object, path graphics object, and form XObject graphics object can have this property. If try to set color state for rest unsupported types, exception fsdk.E_ErrUnsupported will be thrown.
| [in] | color_state | A color state object to be set to current graphics object. |
| def fsdk.GraphicsObject.SetFillColor | ( | color | ) |
Set the fill color.
Text graphics object, path graphics object, and form XObject graphics object can have color state. If try to set fill color for rest unsupported types, fsdk.E_ErrUnsupported will be thrown.
For path graphics object, please ensure the fill mode is not fsdk.E_FillModeNone ; otherwise the fill color will not have any effect on the path graphics object. Please refer to functions fsdk.PathObject.GetFillMode and fsdk.PathObject.SetFillMode to check and change the fill mode of a path graphics object.
Function fsdk.GraphicsObject.SetColorState can be used to set fill color in other color space, like CMYK color space.
| [in] | color | New color value, in format 0xAARRGGBB. |
| def fsdk.GraphicsObject.SetFillOpacity | ( | opacity | ) |
Set the opacity value for painting operations other than stroking.
| [in] | opacity | The new opacity value. Valid range: 0.0 to 1.0. 0.0 means full transparency and 1.0 means full opaque. |
| def fsdk.GraphicsObject.SetGraphState | ( | graph_state | ) |
Set graph state.
Form XObjet graphics object, path graphics object and text graphics object (whose text mode is fsdk.TextStateE_ModeStroke , fsdk.TextStateE_ModeStrokeClip , fsdk.TextStateE_ModeFillStroke or fsdk.TextStateE_ModeFillStrokeClip ) can have this property. If try to set graph state to rest unsupported types, exception fsdk.E_ErrUnsupported will be thrown.
| [in] | graph_state | New graph state. |
| def fsdk.GraphicsObject.SetMatrix | ( | matrix | ) |
Set matrix.
| [in] | matrix | New matrix value. |
| def fsdk.GraphicsObject.SetStrokeColor | ( | color | ) |
Set the stroke color.
Text graphics object, path graphics object, and form XObject graphics object can have this property. If current graphics object is a text graphics object and the text mode is fsdk.TextStateE_ModeFill , the stroke color will not have effect on the text graphics object.
If try to set stroke color for rest unsupported types, exception fsdk.E_ErrUnsupported will be thrown.
Function fsdk.GraphicsObject.SetColorState can be used to set stroke color in other color space, like CMYK color space.
| [in] | color | New color value, in format 0xAARRGGBB. |
| def fsdk.GraphicsObject.SetStrokeOpacity | ( | opacity | ) |
Set opacity value for stroke painting operations for paths and glyph outlines.
| [in] | opacity | The new opacity value. Valid range: 0.0 to 1.0. 0.0 means full transparency and 1.0 means full opaque. |
| def fsdk.GraphicsObject.Transform | ( | matrix, | |
| need_transform_clippath | |||
| ) |
Transform current graphics object.
| [in] | matrix | Transform matrix. |
| [in] | need_transform_clippath | true means to transform clip path with current graphics object. false means to transform current graphics object only. |