Foxit PDF SDK
|
Public Member Functions | |
AddClipPath (path, fill_mode) | |
Add a path for clipping. More... | |
AddClipTextObject (textobject) | |
Add text object for clipping. More... | |
ClearClips () | |
Clear all clips. More... | |
Clone () | |
Clone a new graphics object. More... | |
Clone (src_graphicsobjects, dest_graphicsobjects) | |
Clone a new graphics object. More... | |
GetBlendMode () | |
Get the blend mode for transparent imaging model. More... | |
GetClipPath (index) | |
Get a path clip by index. More... | |
GetClipPathCount () | |
Get the count of path clip. More... | |
GetClipPathFillMode (index) | |
Get the fill mode of a path clip by index. More... | |
GetClipRect () | |
Get clip rectangle. More... | |
GetClipTextObject (index) | |
Get the text object of a text clip by index. More... | |
GetClipTextObjectCount () | |
Get the count of text clip. More... | |
GetColorState () | |
Get color state. More... | |
GetFillColor () | |
Get the fill color. More... | |
GetFillOpacity () | |
Get the opacity value for painting operations other than stroking. More... | |
GetFormXObject () | |
Get the form XObject graphics object if current graphics object represents a form XObject object. More... | |
GetGraphState () | |
Get graph state. More... | |
GetImageObject () | |
Get the image graphics object if current graphics object represents an image object. More... | |
GetLayers (layer_tree) | |
Get all the layers which are associated with current graphics object. More... | |
GetMarkedContent () | |
Get marked content object. More... | |
GetMatrix () | |
Get matrix. More... | |
GetPathObject () | |
Get the path graphics object if current graphics object represents a path object. More... | |
GetRect () | |
Get the rectangle of current graphics object. More... | |
GetShadingObject () | |
Get the shading graphics object if current graphics object represents a shading object. More... | |
GetStrokeColor () | |
Get the stroke color. More... | |
GetStrokeOpacity () | |
Get opacity value for stroke painting operations for paths and glyph outlines. More... | |
GetTextObject () | |
Get the text graphics object if current graphics object represents a text object. More... | |
GetType () | |
Get the type of current graphics object. More... | |
HasTransparency () | |
Check whether current graphics object has transparency or not. More... | |
Release () | |
Release a cloned or newly created PDF graphics object which has not been inserted into any PDF page or other object. More... | |
RemoveClipPath (index) | |
Remove a path clip by index. More... | |
RemoveClipTextObject (index) | |
Remove a text clip by index for clipping. More... | |
Rotate (angle) | |
Rotate current graphics object from current state with specified angle degree in clockwise. More... | |
SetBlendMode (blend_mode) | |
Set the blend mode for transparent imaging model. More... | |
SetClipRect (clip_rect) | |
Set clip rectangle. More... | |
SetColorState (color_state) | |
Set color state. More... | |
SetFillColor (color) | |
Set the fill color. More... | |
SetFillOpacity (opacity) | |
Set the opacity value for painting operations other than stroking. More... | |
SetGraphState (graph_state) | |
Set graph state. More... | |
SetMatrix (matrix) | |
Set matrix. More... | |
SetStrokeColor (color) | |
Set the stroke color. More... | |
SetStrokeOpacity (opacity) | |
Set opacity value for stroke painting operations for paths and glyph outlines. More... | |
Transform (matrix, need_transform_clippath) | |
Transform current graphics object. More... | |
Static Public Attributes | |
static | e_BlendColor |
Creates a color with the hue and saturation of the source color, and the luminosity of the backdrop color. More... | |
static | e_BlendColorBurn |
Darkens backdrop color to reflect the source color. More... | |
static | e_BlendColorDodge |
Brightens backdrop color to reflect source colors. More... | |
static | e_BlendDarken |
Select darker one of backdrop and source colors. More... | |
static | e_BlendDifference |
Subtracts the darker of the two constituent colors from lighter colors. More... | |
static | e_BlendExclusion |
Creates a color with the hue of the source color, and the saturation and luminosity of the backdrop color. More... | |
static | e_BlendHardlight |
Multiply or screens colors, depending on source color value. More... | |
static | e_BlendHue |
Creates a color with the hue of the source color, and the saturation and luminosity of the backdrop color. More... | |
static | e_BlendLighten |
Select lighter one of backdrop and source colors. More... | |
static | e_BlendLuminosity |
Creates a color with the luminosity of the source color, and the hue and saturation of the backdrop color. More... | |
static | e_BlendMultiply |
Multiply backdrop by source color values. More... | |
static | e_BlendNormal |
Enumeration for render blend mode. More... | |
static | e_BlendOverlay |
Multiply or screens colors, depending on backdrop color value. More... | |
static | e_BlendSaturation |
Creates a color with the saturation of the source color, and the hue and luminosity of the backdrop color. More... | |
static | e_BlendScreen |
Multiply complements of backdrop by source color values, and then complement the result. More... | |
static | e_BlendSoftlight |
Darkens or lightens colors, depending on source color value. More... | |
static | e_TypeAll |
Enumeration for PDF graphics object type. More... | |
static | e_TypeFormXObject |
Form XObject graphics object. | |
static | e_TypeImage |
Image graphics object. | |
static | e_TypePath |
Path graphics object. | |
static | e_TypeShading |
Shading graphics object. | |
static | e_TypeText |
Text graphics object. | |
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 FSDK.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.
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. |
FSDK.GraphicsObject.AddClipTextObject | ( | textobject | ) |
Add text object for clipping.
[in] | textobject | Text object to be added for clipping. |
FSDK.GraphicsObject.ClearClips | ( | ) |
Clear all clips.
FSDK.GraphicsObject.Clone | ( | ) |
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.
FSDK.GraphicsObject.Clone | ( | src_graphicsobjects | , |
dest_graphicsobjects | |||
) |
Clone a new graphics object.
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.
FSDK.GraphicsObject.GetBlendMode | ( | ) |
Get the blend mode for transparent imaging model.
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. |
FSDK.GraphicsObject.GetClipPathCount | ( | ) |
Get the count of path clip.
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. |
FSDK.GraphicsObject.GetClipRect | ( | ) |
Get clip rectangle.
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. |
FSDK.GraphicsObject.GetClipTextObjectCount | ( | ) |
Get the count of text clip.
FSDK.GraphicsObject.GetColorState | ( | ) |
Get color state.
Text graphics object, path graphics object, and form XObject graphics object can have color state.
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.
FSDK.GraphicsObject.GetFillOpacity | ( | ) |
Get the opacity value for painting operations other than stroking.
FSDK.GraphicsObject.GetFormXObject | ( | ) |
Get the form XObject graphics object if current graphics object represents a form XObject object.
FSDK.GraphicsObject.GetGraphState | ( | ) |
Get graph state.
Form XObjet graphics object, path graphics object and text graphics object can have this property.
FSDK.GraphicsObject.GetImageObject | ( | ) |
Get the image graphics object if current graphics object represents an image object.
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. |
FSDK.GraphicsObject.GetMarkedContent | ( | ) |
Get marked content object.
FSDK.GraphicsObject.GetMatrix | ( | ) |
Get matrix.
FSDK.GraphicsObject.GetPathObject | ( | ) |
Get the path graphics object if current graphics object represents a path object.
FSDK.GraphicsObject.GetRect | ( | ) |
Get the rectangle of current graphics object.
FSDK.GraphicsObject.GetShadingObject | ( | ) |
Get the shading graphics object if current graphics object represents a shading object.
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.
FSDK.GraphicsObject.GetStrokeOpacity | ( | ) |
Get opacity value for stroke painting operations for paths and glyph outlines.
FSDK.GraphicsObject.GetTextObject | ( | ) |
Get the text graphics object if current graphics object represents a text object.
FSDK.GraphicsObject.GetType | ( | ) |
Get the type of current graphics object.
FSDK.GraphicsObject.HasTransparency | ( | ) |
Check whether current graphics object has transparency or not.
FSDK.GraphicsObject.Release | ( | ) |
Release a cloned or newly created PDF graphics object which has not been inserted into any PDF page or other object.
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. |
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. |
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. |
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.GraphicsObject.e_BlendNormal and this should be one of these values. |
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. |
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. |
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. |
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. |
FSDK.GraphicsObject.SetGraphState | ( | graph_state | ) |
Set graph state.
Form XObjet graphics object, path graphics object and text graphics object (whose text mode is FSDK.TextState.e_ModeStroke, FSDK.TextState.e_ModeStrokeClip, FSDK.TextState.e_ModeFillStroke or FSDK.TextState.e_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. |
FSDK.GraphicsObject.SetMatrix | ( | matrix | ) |
Set matrix.
[in] | matrix | New matrix value. |
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.TextState.e_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. |
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. |
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. |
|
static |
Creates a color with the hue and saturation of the source color, and the luminosity of the backdrop color.
Here is the formula :
B(Cb, Cs) = SetLum(Cs, Lum(Cb)).
|
static |
Darkens backdrop color to reflect the source color.
Painting with white produces no changes.
Here is the formula :
B(Cb, Cs) = -1 - min(1, (1 - Cb) / Cs) if Cs > 0 -0 if Cs = 0
|
static |
Brightens backdrop color to reflect source colors.
Painting with black produces no changes.
Here is the formula :
B(Cb, Cs) = -min(1, Cb / (1 - Cs)) if Cs < 1 -1 if Cs = 1
|
static |
Select darker one of backdrop and source colors.
Here is the formula :
B(Cb, Cs) = min(Cb, Cs).
|
static |
Subtracts the darker of the two constituent colors from lighter colors.
Here is the formula :
B(Cb, Cs) = |Cb - Cs|.
|
static |
Creates a color with the hue of the source color, and the saturation and luminosity of the backdrop color.
Here is the formula :
B(Cb, Cs) = SetLum(SetSat(Cs, Sat(Cb)), Lum(Cb)).
|
static |
Multiply or screens colors, depending on source color value.
Here is the formula :
B(Cb, Cs) = -Multiply(Cb, 2 * Cs) if Cs <= 0.5 -Screen(Cb, 2 * Cs - 1) if Cs > 0.5
|
static |
Creates a color with the hue of the source color, and the saturation and luminosity of the backdrop color.
Here is the formula :
B(Cb, Cs) = SetLum(SetSat(Cs, Sat(Cb)), Lum(Cb)).
|
static |
Select lighter one of backdrop and source colors.
Here is the formula :
B(Cb, Cs) = max(Cb, Cs).
|
static |
Creates a color with the luminosity of the source color, and the hue and saturation of the backdrop color.
Here is the formula :
B(Cb, Cs) = SetLum(Cb, Lum(Cs)).
|
static |
Multiply backdrop by source color values.
Here is the formula :
B(Cb, Cs) = Cb * Cs.
|
static |
Enumeration for render blend mode.
Values of this enumeration should be used alone.
Selecting source color and ignoring backdrop color.
Here is the formula :
B(Cb, Cs) = Cs.
|
static |
Multiply or screens colors, depending on backdrop color value.
Here is the formula :
B(Cb, Cs) = HardLight(Cs, Cb).
|
static |
Creates a color with the saturation of the source color, and the hue and luminosity of the backdrop color.
Here is the formula :
B(Cb, Cs) = SetLum(SetSat(Cb, Sat(Cs)), Lum(Cb)).
|
static |
Multiply complements of backdrop by source color values, and then complement the result.
Here is the formula :
B(Cb, Cs) = 1 - [(1 - Cb) * (1 - Cs)] = Cb + Cs - Cb * Cs.
|
static |
Darkens or lightens colors, depending on source color value.
Here is the formula :
B(Cb, Cs) = -Cb - (1 - 2 * Cs) * Cb * (1 - Cb) if Cs <= 0.5 -Cb + (2 * Cs - 1) * (D(Cb) - Cb) if Cs > 0.5 where D(x) = -((16 * x - 12) * x + 4) * x if x <= 0.25 -sqrt(x) if x > 0.25
|
static |
Enumeration for PDF graphics object type.
Values of this enumeration should be used alone.
Represents all graphics object types, only used as filter.