Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
com.foxit.sdk.pdf.graphics.GraphicsObject Class Reference
Inheritance diagram for com.foxit.sdk.pdf.graphics.GraphicsObject:

## Public Member Functions
boolean | addClipPath (Path path, int fill_mode) throws com.foxit.sdk.PDFException
| Add a path for clipping. More...
boolean | addClipTextObject (TextObject textobject) throws com.foxit.sdk.PDFException
| Add text object for clipping. More...
boolean | 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...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
boolean | equal (GraphicsObject other)
| Check if input object is equal to current object. More...
int | getBlendMode () throws com.foxit.sdk.PDFException
| Get the blend mode for transparent imaging model. More...
Path | getClipPath (int index) throws com.foxit.sdk.PDFException
| Get a path clip by index. More...
int | getClipPathCount ()
| Get the count of path clip. More...
int | getClipPathFillMode (int index) throws com.foxit.sdk.PDFException
| Get the fill mode of a path clip by index. More...
RectF | getClipRect ()
| Get clip rectangle. More...
TextObject | getClipTextObject (int index) throws com.foxit.sdk.PDFException
| 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...
long | getFillColor ()
| Get the fill color. More...
float | getFillOpacity () throws com.foxit.sdk.PDFException
| 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) throws com.foxit.sdk.PDFException
| Get all the layers which are associated with current graphics object. More...
MarkedContent | getMarkedContent ()
| Get marked content object. More...
Matrix2D | getMatrix () throws com.foxit.sdk.PDFException
| 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...
long | getStrokeColor ()
| Get the stroke color. More...
float | getStrokeOpacity () throws com.foxit.sdk.PDFException
| 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...
int | getType ()
| Get the type of current graphics object. More...
boolean | 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...
boolean | removeClipPath (int index) throws com.foxit.sdk.PDFException
| Remove a path clip by index. More...
boolean | removeClipTextObject (int index) throws com.foxit.sdk.PDFException
| 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 (int blend_mode) throws com.foxit.sdk.PDFException
| Set the blend mode for transparent imaging model. More...
void | setClipRect (RectF clip_rect)
| Set clip rectangle. More...
void | setColorState (ColorState color_state) throws com.foxit.sdk.PDFException
| Set color state. More...
void | setFillColor (long color) throws com.foxit.sdk.PDFException
| Set the fill color. More...
void | setFillOpacity (float opacity) throws com.foxit.sdk.PDFException
| Set the opacity value for painting operations other than stroking. More...
void | setGraphState (GraphState graph_state) throws com.foxit.sdk.PDFException
| Set graph state. More...
void | setMatrix (Matrix2D matrix) throws com.foxit.sdk.PDFException
| Set matrix. More...
void | setStrokeColor (long color) throws com.foxit.sdk.PDFException
| Set the stroke color. More...
void | setStrokeOpacity (float opacity) throws com.foxit.sdk.PDFException
| Set opacity value for stroke painting operations for paths and glyph outlines. More...
boolean | transform (Matrix2D matrix, boolean need_transform_clippath)
| Transform current graphics object. More...

## Static Public Attributes
static final int | e_BlendColor = 23
| Creates a color with the hue and saturation of the source color, and the luminosity of the backdrop color. More...
static final int | e_BlendColorBurn = 7
| Darkens backdrop color to reflect the source color. More...
static final int | e_BlendColorDodge = 6
| Brightens backdrop color to reflect source colors. More...
static final int | e_BlendDarken = 4
| Select darker one of backdrop and source colors. More...
static final int | e_BlendDifference = 10
| Subtracts the darker of the two constituent colors from lighter colors. More...
static final int | e_BlendExclusion = 11
| Creates a color with the hue of the source color, and the saturation and luminosity of the backdrop color. More...
static final int | e_BlendHardlight = 8
| Multiply or screens colors, depending on source color value. More...
static final int | e_BlendHue = 21
| Creates a color with the hue of the source color, and the saturation and luminosity of the backdrop color. More...
static final int | e_BlendLighten = 5
| Select lighter one of backdrop and source colors. More...
static final int | e_BlendLuminosity = 24
| Creates a color with the luminosity of the source color, and the hue and saturation of the backdrop color. More...
static final int | e_BlendMultiply = 1
| Multiply backdrop by source color values. More...
static final int | e_BlendNormal = 0
| Selecting source color and ignoring backdrop color. More...
static final int | e_BlendOverlay = 3
| Multiply or screens colors, depending on backdrop color value. More...
static final int | e_BlendSaturation = 22
| Creates a color with the saturation of the source color, and the hue and luminosity of the backdrop color. More...
static final int | e_BlendScreen = 2
| Multiply complements of backdrop by source color values, and then complement the result. More...
static final int | e_BlendSoftlight = 9
| Darkens or lightens colors, depending on source color value. More...
static final int | e_TypeAll = 0
| Represents all graphics object types, only used as filter.
static final int | e_TypeEmptyMarkedContent = 7
| Empty marked-content object.
static final int | e_TypeFormXObject = 5
| Form XObject graphics object.
static final int | e_TypeImage = 3
| Image graphics object.
static final int | e_TypeInlines = 6
| Inline graphics object.
static final int | e_TypePath = 2
| Path graphics object.
static final int | e_TypeShading = 4
| Shading graphics object.
static final int | e_TypeText = 1
| Text graphics object.

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

See also
  com.foxit.sdk.pdf.GraphicsObjects

## Member Function Documentation

## ◆ addClipPath()

boolean com.foxit.sdk.pdf.graphics.GraphicsObject.addClipPath | ( | Path | path,
|  | int | fill_mode
| ) |  | throws com.foxit.sdk.PDFException

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 com.foxit.sdk.common.Constants.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()

boolean com.foxit.sdk.pdf.graphics.GraphicsObject.addClipTextObject | ( | TextObject | textobject | ) | throws com.foxit.sdk.PDFException

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()

boolean com.foxit.sdk.pdf.graphics.GraphicsObject.clearClips | ( |  | ) |

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 com.foxit.sdk.pdf.graphics.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 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 com.foxit.sdk.pdf.graphics.GraphicsObject.clone | ( | GraphicsObjects | src_graphicsobjects,
|  | 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 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.

## ◆ delete()

synchronized void com.foxit.sdk.pdf.graphics.GraphicsObject.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

## ◆ equal()

boolean com.foxit.sdk.pdf.graphics.GraphicsObject.equal | ( | GraphicsObject | other | ) |

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()

int com.foxit.sdk.pdf.graphics.GraphicsObject.getBlendMode | ( |  | ) | throws com.foxit.sdk.PDFException

Get the blend mode for transparent imaging model.

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

## ◆ getClipPath()

Path com.foxit.sdk.pdf.graphics.GraphicsObject.getClipPath | ( | int | index | ) | throws com.foxit.sdk.PDFException

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 com.foxit.sdk.pdf.graphics.GraphicsObject.getClipPathCount | ( |  | ) |

Get the count of path clip.

Returns
  Count of path clip.

## ◆ getClipPathFillMode()

int com.foxit.sdk.pdf.graphics.GraphicsObject.getClipPathFillMode | ( | int | index | ) | throws com.foxit.sdk.PDFException

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 com.foxit.sdk.common.Constants.e_FillModeNone and this would be one of these values.

## ◆ getClipRect()

RectF com.foxit.sdk.pdf.graphics.GraphicsObject.getClipRect | ( |  | ) |

Get clip rectangle.

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

## ◆ getClipTextObject()

TextObject com.foxit.sdk.pdf.graphics.GraphicsObject.getClipTextObject | ( | int | index | ) | throws com.foxit.sdk.PDFException

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 com.foxit.sdk.pdf.graphics.GraphicsObject.getClipTextObjectCount | ( |  | ) |

Get the count of text clip.

Returns
  Count of text clip.

## ◆ getColorState()

ColorState com.foxit.sdk.pdf.graphics.GraphicsObject.getColorState | ( |  | ) |

Get color state.

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

Returns
  Color state.

## ◆ getFillColor()

long com.foxit.sdk.pdf.graphics.GraphicsObject.getFillColor | ( |  | ) |

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 com.foxit.sdk.pdf.graphics.GraphicsObject.getFillOpacity | ( |  | ) | throws com.foxit.sdk.PDFException

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 com.foxit.sdk.pdf.graphics.GraphicsObject.getFormXObject | ( |  | ) |

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 com.foxit.sdk.pdf.graphics.GraphicsObject.getGraphState | ( |  | ) |

Get graph state.

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

Returns
  Graph state.

## ◆ getImageObject()

ImageObject com.foxit.sdk.pdf.graphics.GraphicsObject.getImageObject | ( |  | ) |

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 com.foxit.sdk.pdf.graphics.GraphicsObject.getLayers | ( | LayerTree | layer_tree | ) | throws com.foxit.sdk.PDFException

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 com.foxit.sdk.pdf.graphics.GraphicsObject.getMarkedContent | ( |  | ) |

Get marked content object.

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

## ◆ getMatrix()

Matrix2D com.foxit.sdk.pdf.graphics.GraphicsObject.getMatrix | ( |  | ) | throws com.foxit.sdk.PDFException

Get matrix.

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

## ◆ getPathObject()

PathObject com.foxit.sdk.pdf.graphics.GraphicsObject.getPathObject | ( |  | ) |

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 com.foxit.sdk.pdf.graphics.GraphicsObject.getRect | ( |  | ) |

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 com.foxit.sdk.pdf.graphics.GraphicsObject.getShadingObject | ( |  | ) |

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()

long com.foxit.sdk.pdf.graphics.GraphicsObject.getStrokeColor | ( |  | ) |

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 com.foxit.sdk.pdf.graphics.GraphicsObject.getStrokeOpacity | ( |  | ) | throws com.foxit.sdk.PDFException

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 com.foxit.sdk.pdf.graphics.GraphicsObject.getTextObject | ( |  | ) |

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()

int com.foxit.sdk.pdf.graphics.GraphicsObject.getType | ( |  | ) |

Get the type of current graphics object.

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

## ◆ hasTransparency()

boolean com.foxit.sdk.pdf.graphics.GraphicsObject.hasTransparency | ( |  | ) |

Check whether current graphics object has transparency or not.

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

## ◆ release()

void com.foxit.sdk.pdf.graphics.GraphicsObject.release | ( |  | ) |

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

Returns
  None.

## ◆ removeClipPath()

boolean com.foxit.sdk.pdf.graphics.GraphicsObject.removeClipPath | ( | int | index | ) | throws com.foxit.sdk.PDFException

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()

boolean com.foxit.sdk.pdf.graphics.GraphicsObject.removeClipTextObject | ( | int | index | ) | throws com.foxit.sdk.PDFException

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 com.foxit.sdk.pdf.graphics.GraphicsObject.rotate | ( | int | angle | ) |

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 com.foxit.sdk.pdf.graphics.GraphicsObject.setBlendMode | ( | int | blend_mode | ) | throws com.foxit.sdk.PDFException

Set the blend mode for transparent imaging model.

Parameters

  [in] | blend_mode | New blend mode. Please refer to values starting from com.foxit.sdk.pdf.graphics.GraphicsObject.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 com.foxit.sdk.pdf.graphics.GraphicsObject.setClipRect | ( | RectF | clip_rect | ) |

Set clip rectangle.

New clip rectangle will be set with fill mode com.foxit.sdk.common.Constants.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 com.foxit.sdk.pdf.graphics.GraphicsObject.setColorState | ( | ColorState | color_state | ) | throws com.foxit.sdk.PDFException

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 com.foxit.sdk.common.Constants.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 com.foxit.sdk.pdf.graphics.GraphicsObject.setFillColor | ( | long | color | ) | throws com.foxit.sdk.PDFException

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, com.foxit.sdk.common.Constants.e_ErrUnsupported will be thrown.
For path graphics object, please ensure the fill mode is not com.foxit.sdk.common.Constants.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 com.foxit.sdk.pdf.graphics.GraphicsObject.setFillOpacity | ( | float | opacity | ) | throws com.foxit.sdk.PDFException

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 com.foxit.sdk.pdf.graphics.GraphicsObject.setGraphState | ( | GraphState | graph_state | ) | throws com.foxit.sdk.PDFException

Set graph state.

Form XObjet graphics object, path graphics object and text graphics object (whose text mode is com.foxit.sdk.pdf.graphics.TextState.e_ModeStroke , com.foxit.sdk.pdf.graphics.TextState.e_ModeStrokeClip , com.foxit.sdk.pdf.graphics.TextState.e_ModeFillStroke or com.foxit.sdk.pdf.graphics.TextState.e_ModeFillStrokeClip ) can have this property. If try to set graph state to rest unsupported types, exception com.foxit.sdk.common.Constants.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 com.foxit.sdk.pdf.graphics.GraphicsObject.setMatrix | ( | Matrix2D | matrix | ) | throws com.foxit.sdk.PDFException

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 com.foxit.sdk.pdf.graphics.GraphicsObject.setStrokeColor | ( | long | color | ) | throws com.foxit.sdk.PDFException

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 com.foxit.sdk.pdf.graphics.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 com.foxit.sdk.common.Constants.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 com.foxit.sdk.pdf.graphics.GraphicsObject.setStrokeOpacity | ( | float | opacity | ) | throws com.foxit.sdk.PDFException

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()

boolean com.foxit.sdk.pdf.graphics.GraphicsObject.transform | ( | Matrix2D | matrix,
|  | boolean | need_transform_clippath
| ) |  |

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.

## Member Data Documentation

## ◆ e_BlendColor

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendColor = 23
| 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)).

## ◆ e_BlendColorBurn

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendColorBurn = 7
| 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

## ◆ e_BlendColorDodge

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendColorDodge = 6
| 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

## ◆ e_BlendDarken

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendDarken = 4
| static

Select darker one of backdrop and source colors.

Here is the formula :

    B(Cb, Cs) = min(Cb, Cs).

## ◆ e_BlendDifference

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendDifference = 10
| static

Subtracts the darker of the two constituent colors from lighter colors.

Here is the formula :

    B(Cb, Cs) = |Cb - Cs|.

## ◆ e_BlendExclusion

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendExclusion = 11
| 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)).

## ◆ e_BlendHardlight

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendHardlight = 8
| 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

## ◆ e_BlendHue

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendHue = 21
| 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)).

## ◆ e_BlendLighten

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendLighten = 5
| static

Select lighter one of backdrop and source colors.

Here is the formula :

    B(Cb, Cs) = max(Cb, Cs).

## ◆ e_BlendLuminosity

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendLuminosity = 24
| 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)).

## ◆ e_BlendMultiply

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendMultiply = 1
| static

Multiply backdrop by source color values.

Here is the formula :

    B(Cb, Cs) = Cb * Cs.

## ◆ e_BlendNormal

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendNormal = 0
| static

Selecting source color and ignoring backdrop color.

Here is the formula :

    B(Cb, Cs) = Cs.

## ◆ e_BlendOverlay

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendOverlay = 3
| static

Multiply or screens colors, depending on backdrop color value.

Here is the formula :

    B(Cb, Cs) = HardLight(Cs, Cb).

## ◆ e_BlendSaturation

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendSaturation = 22
| 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)).

## ◆ e_BlendScreen

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendScreen = 2
| 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.

## ◆ e_BlendSoftlight

final int com.foxit.sdk.pdf.graphics.GraphicsObject.e_BlendSoftlight = 9
| 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