Foxit PDF SDK

Public Types | Public Member Functions | List of all members
foxit.pdf.graphics.GraphicsObject Class Reference
Inheritance diagram for foxit.pdf.graphics.GraphicsObject:

## Public Types
enum | BlendMode { BlendMode.e_BlendNormal = 0, BlendMode.e_BlendMultiply = 1, BlendMode.e_BlendScreen = 2, BlendMode.e_BlendOverlay = 3, BlendMode.e_BlendDarken = 4, BlendMode.e_BlendLighten = 5, BlendMode.e_BlendColorDodge = 6, BlendMode.e_BlendColorBurn = 7, BlendMode.e_BlendHardlight = 8, BlendMode.e_BlendSoftlight = 9, BlendMode.e_BlendDifference = 10, BlendMode.e_BlendExclusion = 11, BlendMode.e_BlendHue = 21, BlendMode.e_BlendSaturation = 22, BlendMode.e_BlendColor = 23, BlendMode.e_BlendLuminosity = 24 }
| Enumeration for render blend mode. More...
enum | Type { Type.e_TypeAll = 0, Type.e_TypeText = 1, Type.e_TypePath = 2, Type.e_TypeImage = 3, Type.e_TypeShading = 4, Type.e_TypeFormXObject = 5, Type.e_TypeInlines = 6, Type.e_TypeEmptyMarkedContent = 7 }
| Enumeration for PDF graphics object type. More...

## Public Member Functions
bool | AddClipPath (Path path, FillMode fill_mode)
| Add a path for clipping. More...
bool | AddClipTextObject (TextObject textobject)
| Add text object for clipping. More...
bool | ClearClips ()
| Clear all clips. More...
GraphicsObject | Clone ()
| Clone a new graphics object. More...
GraphicsObject | Clone (GraphicsObjects src_graphicsobjects, GraphicsObjects dest_graphicsobjects)
| Clone a new graphics object. More...
bool | Equal (GraphicsObject other)
| Check if input object is equal to current object. More...
GraphicsObject.BlendMode | GetBlendMode ()
| Get the blend mode for transparent imaging model. More...
Path | GetClipPath (int index)
| Get a path clip by index. More...
int | GetClipPathCount ()
| Get the count of path clip. More...
FillMode | GetClipPathFillMode (int index)
| Get the fill mode of a path clip by index. More...
RectF | GetClipRect ()
| Get clip rectangle. More...
TextObject | GetClipTextObject (int index)
| Get the text object of a text clip by index. More...
int | GetClipTextObjectCount ()
| Get the count of text clip. More...
ColorState | GetColorState ()
| Get color state. More...
uint | GetFillColor ()
| Get the fill color. More...
float | GetFillOpacity ()
| Get the opacity value for painting operations other than stroking. More...
FormXObject | GetFormXObject ()
| Get the form XObject graphics object if current graphics object represents a form XObject object. More...
GraphState | GetGraphState ()
| Get graph state. More...
ImageObject | GetImageObject ()
| Get the image graphics object if current graphics object represents an image object. More...
LayerNodeArray | GetLayers (LayerTree layer_tree)
| Get all the layers which are associated with current graphics object. More...
MarkedContent | GetMarkedContent ()
| Get marked content object. More...
Matrix2D | GetMatrix ()
| Get matrix. More...
PathObject | GetPathObject ()
| Get the path graphics object if current graphics object represents a path object. More...
RectF | GetRect ()
| Get the rectangle of current graphics object. More...
ShadingObject | GetShadingObject ()
| Get the shading graphics object if current graphics object represents a shading object. More...
uint | GetStrokeColor ()
| Get the stroke color. More...
float | GetStrokeOpacity ()
| Get opacity value for stroke painting operations for paths and glyph outlines. More...
TextObject | GetTextObject ()
| Get the text graphics object if current graphics object represents a text object. More...
GraphicsObject.Type | GetType ()
| Get the type of current graphics object. More...
bool | HasTransparency ()
| Check whether current graphics object has transparency or not. More...
void | Release ()
| Release a cloned or newly created PDF graphics object which has not been inserted into any PDF page or other object. More...
bool | RemoveClipPath (int index)
| Remove a path clip by index. More...
bool | RemoveClipTextObject (int index)
| Remove a text clip by index for clipping. More...
void | Rotate (int angle)
| Rotate current graphics object from current state with specified angle degree in clockwise. More...
void | SetBlendMode (GraphicsObject.BlendMode blend_mode)
| Set the blend mode for transparent imaging model. More...
void | SetClipRect (RectF clip_rect)
| Set clip rectangle. More...
void | SetColorState (ColorState color_state)
| Set color state. More...
void | SetFillColor (uint color)
| Set the fill color. More...
void | SetFillOpacity (float opacity)
| Set the opacity value for painting operations other than stroking. More...
void | SetGraphState (GraphState graph_state)
| Set graph state. More...
void | SetMatrix (Matrix2D matrix)
| Set matrix. More...
void | SetStrokeColor (uint color)
| Set the stroke color. More...
void | SetStrokeOpacity (float opacity)
| Set opacity value for stroke painting operations for paths and glyph outlines. More...
bool | Transform (Matrix2D matrix, bool need_transform_clippath)
| Transform current graphics object. More...

## Detailed Description

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 foxit.pdf.GraphicsObjects .
If any change is done to a PDF graphics object, please remember to call function GraphicsObjects.GenerateContent for foxit.pdf.GraphicsObjects object (to which current graphics object belongs). Please refer to comment of function GraphicsObjects.GenerateContent for more details.

See also
  foxit.pdf.GraphicsObjects

## Member Enumeration Documentation

## ◆ BlendMode

enum foxit.pdf.graphics.GraphicsObject.BlendMode
| strong

Enumeration for render blend mode.

Values of this enumeration should be used alone.

Enumerator
e_BlendNormal | Selecting source color and ignoring backdrop color. Here is the formula :
    B(Cb, Cs) = Cs.
e_BlendMultiply | Multiply backdrop by source color values. Here is the formula :
    B(Cb, Cs) = Cb * Cs.
e_BlendScreen | 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.
e_BlendOverlay | Multiply or screens colors, depending on backdrop color value. Here is the formula :
    B(Cb, Cs) = HardLight(Cs, Cb).
e_BlendDarken | Select darker one of backdrop and source colors. Here is the formula :
    B(Cb, Cs) = min(Cb, Cs).
e_BlendLighten | Select lighter one of backdrop and source colors. Here is the formula :
    B(Cb, Cs) = max(Cb, Cs).
e_BlendColorDodge | 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
e_BlendColorBurn | 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
e_BlendHardlight | 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
e_BlendSoftlight | 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
e_BlendDifference | Subtracts the darker of the two constituent colors from lighter colors. Here is the formula :
    B(Cb, Cs) = |Cb - Cs|.
e_BlendExclusion | 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)).
e_BlendHue | 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)).
e_BlendSaturation | 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)).
e_BlendColor | 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)).
e_BlendLuminosity | 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)).

## ◆ Type

enum foxit.pdf.graphics.GraphicsObject.Type
| strong

Enumeration for PDF graphics object type.

Values of this enumeration should be used alone.

Enumerator
e_TypeAll | Represents all graphics object types, only used as filter.
e_TypeText | Text graphics object.
e_TypePath | Path graphics object.
e_TypeImage | Image graphics object.
e_TypeShading | Shading graphics object.
e_TypeFormXObject | Form XObject graphics object.
e_TypeInlines | Inline graphics object.
e_TypeEmptyMarkedContent | Empty marked-content object.

## Member Function Documentation

## ◆ AddClipPath()

bool foxit.pdf.graphics.GraphicsObject.AddClipPath | ( | Path | path,
|  | FillMode | fill_mode
| ) |  |
| inline

Add a path for clipping.

Parameters

  [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 foxit.common.FillMode.e_FillModeNone and this should be one of these values.

Returns
  true means success, while false means failure.

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

## ◆ AddClipTextObject()

bool foxit.pdf.graphics.GraphicsObject.AddClipTextObject | ( | TextObject | textobject | ) |
| inline

Add text object for clipping.

Parameters

  [in] | textobject | Text object to be added for clipping.

Returns
  true means success, while false means failure.

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

## ◆ ClearClips()

bool foxit.pdf.graphics.GraphicsObject.ClearClips | ( |  | ) |
| inline

Clear all clips.

Returns
  true means success, while false means failure.

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

## ◆ Clone() [1/2]

GraphicsObject foxit.pdf.graphics.GraphicsObject.Clone | ( |  | ) |
| inline

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 GraphicsObject.Release to release it when not use it any more.

Returns
  Cloned graphics object. If there is any error, this function will return null.

## ◆ Clone() [2/2]

GraphicsObject foxit.pdf.graphics.GraphicsObject.Clone | ( | GraphicsObjects | src_graphicsobjects,
|  | GraphicsObjects | dest_graphicsobjects
| ) |  |
| inline

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 GraphicsObject.Release to release it when not use it any more.

Parameters

  [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.

Returns
  Cloned graphics object. If there is any error, this function will return null.

## ◆ Equal()

bool foxit.pdf.graphics.GraphicsObject.Equal | ( | GraphicsObject | other | ) |
| inline

Check if input object is equal to current object.

Parameters

  [in] | other | Another graphics object. This function will check if current object is equal to this one.

Returns
  true means equal, while false means not equal.

## ◆ GetBlendMode()

GraphicsObject.BlendMode foxit.pdf.graphics.GraphicsObject.GetBlendMode | ( |  | ) |
| inline

Get the blend mode for transparent imaging model.

Returns
  The Blend mode for transparent imaging model. Please refer to values starting from foxit.pdf.graphics.GraphicsObject.BlendMode.e_BlendNormal and this would be one of these values.

## ◆ GetClipPath()

Path foxit.pdf.graphics.GraphicsObject.GetClipPath | ( | int | index | ) |
| inline

Get a path clip by index.

Parameters

  [in] | index | Path clip index. Valid range: from 0 to (count-1). count is returned by function GraphicsObject.GetClipPath .

Returns
  Path data. If the return value of function common.Path.IsEmpty for the returned path object is true, that means there is any error.

## ◆ GetClipPathCount()

int foxit.pdf.graphics.GraphicsObject.GetClipPathCount | ( |  | ) |
| inline

Get the count of path clip.

Returns
  Count of path clip.

## ◆ GetClipPathFillMode()

FillMode foxit.pdf.graphics.GraphicsObject.GetClipPathFillMode | ( | int | index | ) |
| inline

Get the fill mode of a path clip by index.

Parameters

  [in] | index | Path clip index. Valid range: from 0 to (count-1). count is returned by function GraphicsObject.GetClipPath .

Returns
  Fill mode. Please refer to values starting from foxit.common.FillMode.e_FillModeNone and this would be one of these values.

## ◆ GetClipRect()

RectF foxit.pdf.graphics.GraphicsObject.GetClipRect | ( |  | ) |
| inline

Get clip rectangle.

Returns
  Clip rectangle. If there is no clip rectangle, a RectF object with all values 0 will be returned.

## ◆ GetClipTextObject()

TextObject foxit.pdf.graphics.GraphicsObject.GetClipTextObject | ( | int | index | ) |
| inline

Get the text object of a text clip by index.

Parameters

  [in] | index | Text clip index. Valid range: from 0 to (count-1). count is returned by function GraphicsObject.GetClipTextObjectCount .

Returns
  A text graphics object. If there is any error, this function will return null.

## ◆ GetClipTextObjectCount()

int foxit.pdf.graphics.GraphicsObject.GetClipTextObjectCount | ( |  | ) |
| inline

Get the count of text clip.

Returns
  Count of text clip.

## ◆ GetColorState()

ColorState foxit.pdf.graphics.GraphicsObject.GetColorState | ( |  | ) |
| inline

Get color state.

Text graphics object, path graphics object, and form XObject graphics object can have color state.

Returns
  Color state.

## ◆ GetFillColor()

uint foxit.pdf.graphics.GraphicsObject.GetFillColor | ( |  | ) |
| inline

Get the fill color.

Text graphics object, path graphics object, and form XObject graphics object can have this property. Function GraphicsObject.GetColorState can be used to get fille color in other color space, like CMYK color space.

Returns
  Color value, in format 0xAARRGGBB.

## ◆ GetFillOpacity()

float foxit.pdf.graphics.GraphicsObject.GetFillOpacity | ( |  | ) |
| inline

Get the opacity value for painting operations other than stroking.

Returns
  The opacity value. Valid range: 0.0 to 1.0. 0.0 means full transparency and 1.0 means full opaque. If no opacity value can be found, 1 will be returned as default value.

## ◆ GetFormXObject()

FormXObject foxit.pdf.graphics.GraphicsObject.GetFormXObject | ( |  | ) |
| inline

Get the form XObject graphics object if current graphics object represents a form XObject object.

Returns
  Form XObject graphics object. If current graphics object does not represent a form XObject object, this function will return null.

## ◆ GetGraphState()

GraphState foxit.pdf.graphics.GraphicsObject.GetGraphState | ( |  | ) |
| inline

Get graph state.

Form XObjet graphics object, path graphics object and text graphics object can have this property.

Returns
  Graph state.

## ◆ GetImageObject()

ImageObject foxit.pdf.graphics.GraphicsObject.GetImageObject | ( |  | ) |
| inline

Get the image graphics object if current graphics object represents an image object.

Returns
  Image graphics object. If current graphics object does not represent an image object, this function will return null.

## ◆ GetLayers()

LayerNodeArray foxit.pdf.graphics.GraphicsObject.GetLayers | ( | LayerTree | layer_tree | ) |
| inline

Get all the layers which are associated with current graphics object.

Parameters

  [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.

Returns
  A layer node array which contains all the matched layer node.

## ◆ GetMarkedContent()

MarkedContent foxit.pdf.graphics.GraphicsObject.GetMarkedContent | ( |  | ) |
| inline

Get marked content object.

Returns
  A marked content object. If there is any error, this function will return null.

## ◆ GetMatrix()

Matrix2D foxit.pdf.graphics.GraphicsObject.GetMatrix | ( |  | ) |
| inline

Get matrix.

Returns
  Matrix value. If there is any error, this function will return a Matrix with all values 0.

## ◆ GetPathObject()

PathObject foxit.pdf.graphics.GraphicsObject.GetPathObject | ( |  | ) |
| inline

Get the path graphics object if current graphics object represents a path object.

Returns
  Path graphics object. If current graphics object does not represent a path object, this function will return null.

## ◆ GetRect()

RectF foxit.pdf.graphics.GraphicsObject.GetRect | ( |  | ) |
| inline

Get the rectangle of current graphics object.

Returns
  Rectangle of current graphics object. If there is any error, this function will return a RectF object with all values 0.

## ◆ GetShadingObject()

ShadingObject foxit.pdf.graphics.GraphicsObject.GetShadingObject | ( |  | ) |
| inline

Get the shading graphics object if current graphics object represents a shading object.

Returns
  Shading graphics object. If current graphics object does not represent a shading object, this function will return null.

## ◆ GetStrokeColor()

uint foxit.pdf.graphics.GraphicsObject.GetStrokeColor | ( |  | ) |
| inline

Get the stroke color.

Text graphics object, path graphics object, and form XObject graphics object can have this property.
Function GraphicsObject.GetColorState can be used to get stroke color in other color space, like CMYK color space.

Returns
  Color value, in format 0xAARRGGBB.

## ◆ GetStrokeOpacity()

float foxit.pdf.graphics.GraphicsObject.GetStrokeOpacity | ( |  | ) |
| inline

Get opacity value for stroke painting operations for paths and glyph outlines.

Returns
  The opacity value. Valid range: 0.0 to 1.0. 0.0 means full transparency and 1.0 means full opaque. If no opacity value can be found, 1 will be returned as default value.

## ◆ GetTextObject()

TextObject foxit.pdf.graphics.GraphicsObject.GetTextObject | ( |  | ) |
| inline

Get the text graphics object if current graphics object represents a text object.

Returns
  Text graphics object. If current graphics object does not represent a text object, this function will return null.

## ◆ GetType()

GraphicsObject.Type foxit.pdf.graphics.GraphicsObject.GetType | ( |  | ) |
| inline

Get the type of current graphics object.

Returns
  Graphics object type. Please refer to values starting from foxit.pdf.graphics.GraphicsObject.Type.e_TypeText and this would be one of these values except foxit.pdf.graphics.GraphicsObject.Type.e_TypeAll .

## ◆ HasTransparency()

bool foxit.pdf.graphics.GraphicsObject.HasTransparency | ( |  | ) |
| inline

Check whether current graphics object has transparency or not.

Returns
  true means current graphics object has transparency, while false means not.

## ◆ Release()

void foxit.pdf.graphics.GraphicsObject.Release | ( |  | ) |
| inline

Release a cloned or newly created PDF graphics object which has not been inserted into any PDF page or other object.

Returns
  None.

## ◆ RemoveClipPath()

bool foxit.pdf.graphics.GraphicsObject.RemoveClipPath | ( | int | index | ) |
| inline

Remove a path clip by index.

Parameters

  [in] | index | Path clip index. Valid range: from 0 to (count-1). count is returned by function GraphicsObject.GetClipPath .

Returns
  true means success, while false means failure.

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

## ◆ RemoveClipTextObject()

bool foxit.pdf.graphics.GraphicsObject.RemoveClipTextObject | ( | int | index | ) |
| inline

Remove a text clip by index for clipping.

Parameters

  [in] | index | Text clip index. Valid range: from 0 to (count-1). count is returned by function GraphicsObject.GetClipTextObjectCount .

Returns
  true means success, while false means failure.

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

## ◆ Rotate()

void foxit.pdf.graphics.GraphicsObject.Rotate | ( | int | angle | ) |
| inline

Rotate current graphics object from current state with specified angle degree in clockwise.

Parameters

  [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.

Returns
  None.

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

## ◆ SetBlendMode()

void foxit.pdf.graphics.GraphicsObject.SetBlendMode | ( | GraphicsObject.BlendMode | blend_mode | ) |
| inline

Set the blend mode for transparent imaging model.

Parameters

  [in] | blend_mode | New blend mode. Please refer to values starting from foxit.pdf.graphics.GraphicsObject.BlendMode.e_BlendNormal and this should be one of these values.

Returns
  None.

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

## ◆ SetClipRect()

void foxit.pdf.graphics.GraphicsObject.SetClipRect | ( | RectF | clip_rect | ) |
| inline

Set clip rectangle.

New clip rectangle will be set with fill mode foxit.common.FillMode.e_FillModeWinding by default.

Parameters

  [in] | clip_rect | New clip rectangle.

Returns
  None.

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

## ◆ SetColorState()

void foxit.pdf.graphics.GraphicsObject.SetColorState | ( | ColorState | color_state | ) |
| inline

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 foxit.common.ErrorCode.e_ErrUnsupported will be thrown.

Parameters

  [in] | color_state | A color state object to be set to current graphics object.

Returns
  None.

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

## ◆ SetFillColor()

void foxit.pdf.graphics.GraphicsObject.SetFillColor | ( | uint | color | ) |
| inline

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, foxit.common.ErrorCode.e_ErrUnsupported will be thrown.
For path graphics object, please ensure the fill mode is not foxit.common.FillMode.e_FillModeNone ; otherwise the fill color will not have any effect on the path graphics object. Please refer to functions PathObject.GetFillMode and PathObject.SetFillMode to check and change the fill mode of a path graphics object.
Function GraphicsObject.SetColorState can be used to set fill color in other color space, like CMYK color space.

Parameters

  [in] | color | New color value, in format 0xAARRGGBB.

Returns
  None.

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

## ◆ SetFillOpacity()

void foxit.pdf.graphics.GraphicsObject.SetFillOpacity | ( | float | opacity | ) |
| inline

Set the opacity value for painting operations other than stroking.

Parameters

  [in] | opacity | The new opacity value. Valid range: 0.0 to 1.0. 0.0 means full transparency and 1.0 means full opaque.

Returns
  None.

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

## ◆ SetGraphState()

void foxit.pdf.graphics.GraphicsObject.SetGraphState | ( | GraphState | graph_state | ) |
| inline

Set graph state.

Form XObjet graphics object, path graphics object and text graphics object (whose text mode is foxit.pdf.graphics.TextState.Mode.e_ModeStroke , foxit.pdf.graphics.TextState.Mode.e_ModeStrokeClip , foxit.pdf.graphics.TextState.Mode.e_ModeFillStroke or foxit.pdf.graphics.TextState.Mode.e_ModeFillStrokeClip ) can have this property. If try to set graph state to rest unsupported types, exception foxit.common.ErrorCode.e_ErrUnsupported will be thrown.

Parameters

  [in] | graph_state | New graph state.

Returns
  None.

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

## ◆ SetMatrix()

void foxit.pdf.graphics.GraphicsObject.SetMatrix | ( | Matrix2D | matrix | ) |
| inline

Set matrix.

Parameters

  [in] | matrix | New matrix value.

Returns
  None.

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

## ◆ SetStrokeColor()

void foxit.pdf.graphics.GraphicsObject.SetStrokeColor | ( | uint | color | ) |
| inline

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 foxit.pdf.graphics.TextState.Mode.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 foxit.common.ErrorCode.e_ErrUnsupported will be thrown.
Function GraphicsObject.SetColorState can be used to set stroke color in other color space, like CMYK color space.

Parameters

  [in] | color | New color value, in format 0xAARRGGBB.

Returns
  None.

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

## ◆ SetStrokeOpacity()

void foxit.pdf.graphics.GraphicsObject.SetStrokeOpacity | ( | float | opacity | ) |
| inline

Set opacity value for stroke painting operations for paths and glyph outlines.

Parameters

  [in] | opacity | The new opacity value. Valid range: 0.0 to 1.0. 0.0 means full transparency and 1.0 means full opaque.

Returns
  None.

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

## ◆ Transform()

bool foxit.pdf.graphics.GraphicsObject.Transform | ( | Matrix2D | matrix,
|  | bool | need_transform_clippath
| ) |  |
| inline

Transform current graphics object.

Parameters

  [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.

Returns
  true means success, while false means failure.

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