Foxit PDF SDK
foxit::pdf::graphics::PathObject Class Reference
Inheritance diagram for foxit::pdf::graphics::PathObject:
foxit::pdf::graphics::GraphicsObject

Public Member Functions

common::FillMode GetFillMode () const
 Get fill mode. More...
 
common::Path GetPathData () const
 Get the path data. More...
 
bool GetStrokeState () const
 Get stroke state. More...
 
void SetFillMode (common::FillMode fill_mode)
 Set fill mode. More...
 
void SetPathData (const common::Path &path_data)
 Set the path data. More...
 
void SetStrokeState (bool is_stroke)
 Set stroke state. More...
 
- Public Member Functions inherited from foxit::pdf::graphics::GraphicsObject
bool AddClipPath (const common::Path &path, common::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...
 
GraphicsObjectClone ()
 Clone a new graphics object. More...
 
BlendMode GetBlendMode () const
 Get the blend mode for transparent imaging model. More...
 
common::Path GetClipPath (int index) const
 Get a path clip by index. More...
 
int GetClipPathCount () const
 Get the count of path clip. More...
 
common::FillMode GetClipPathFillMode (int index) const
 Get the fill mode of a path clip by index. More...
 
RectF GetClipRect () const
 Get clip rectangle. More...
 
TextObjectGetClipTextObject (int index) const
 Get the text object of a text clip by index. More...
 
int GetClipTextObjectCount () const
 Get the count of text clip. More...
 
ColorState GetColorState () const
 Get color state. More...
 
ARGB GetFillColor () const
 Get the fill color. More...
 
float GetFillOpacity () const
 Get the opacity value for painting operations other than stroking. More...
 
FormXObjectGetFormXObject () const
 Get the form XObject graphics object if current graphics object represents a form XObject object. More...
 
common::GraphState GetGraphState () const
 Get graph state. More...
 
ImageObjectGetImageObject () const
 Get the image graphics object if current graphics object represents an image object. More...
 
LayerNodeArray GetLayers (const LayerTree &layer_tree)
 Get all the layers which are associated with current graphics object. More...
 
MarkedContentGetMarkedContent () const
 Get marked content object. More...
 
Matrix GetMatrix () const
 Get matrix. More...
 
PathObjectGetPathObject () const
 Get the path graphics object if current graphics object represents a path object. More...
 
RectF GetRect () const
 Get the rectangle of current graphics object. More...
 
ShadingObjectGetShadingObject () const
 Get the shading graphics object if current graphics object represents a shading object. More...
 
ARGB GetStrokeColor () const
 Get the stroke color. More...
 
float GetStrokeOpacity () const
 Get opacity value for stroke painting operations for paths and glyph outlines. More...
 
TextObjectGetTextObject () const
 Get the text graphics object if current graphics object represents a text object. More...
 
Type GetType () const
 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 (BlendMode blend_mode)
 Set the blend mode for transparent imaging model. More...
 
void SetClipRect (const RectF &clip_rect)
 Set clip rectangle. More...
 
void SetColorState (const ColorState &color_state)
 Set color state. More...
 
void SetFillColor (ARGB color)
 Set the fill color. More...
 
void SetFillOpacity (float opacity)
 Set the opacity value for painting operations other than stroking. More...
 
void SetGraphState (const common::GraphState &graph_state)
 Set graph state. More...
 
void SetMatrix (const Matrix &matrix)
 Set matrix. More...
 
void SetStrokeColor (ARGB 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 (const Matrix &matrix, bool need_transform_clippath)
 Transform current graphics object. More...
 

Static Public Member Functions

static PathObjectCreate ()
 Create a new path graphics object. More...
 
static PathObjectCreateFromTextObject (const PDFPage &page, TextObject *text_obj)
 Create a path graphics object from a text object. More...
 

Additional Inherited Members

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

Detailed Description

Path graphics object is a kind of PDF graphics object, so class PathObject is derived from class GraphicsObject. It offers functions to get/set path graphics object's data.
To create a new path graphics object, please use function PathObject::Create and then use setting functions to set information to the new path graphics object. Function PathObject::CreateFromTextObject can be used to create a path graphics object from a text graphics object.

See also
GraphicsObject

Member Function Documentation

◆ Create()

static PathObject* foxit::pdf::graphics::PathObject::Create ( )
static

Create a new path graphics object.

The newly created path graphics object does not have any data yet. Then, setting functions can be called to set data to the new path graphics object.

Returns
A new path graphics object. If there is any error, this function will return NULL.
If the newly created path graphics object will not inserted to any page or other objects, please remember to call function GraphicsObject::Release to release it when no use.

◆ CreateFromTextObject()

static PathObject* foxit::pdf::graphics::PathObject::CreateFromTextObject ( const PDFPage page,
TextObject text_obj 
)
static

Create a path graphics object from a text object.

Parameters
[in]pageA valid PDF page object.
[in]text_objA text graphics object. It should not be NULL. Please ensure the text graphics object is in the PDF page specified by parameter page.
Returns
A new path graphics object. If there is any error, this function will return NULL.
If the newly created path graphics object will not inserted to any page or other objects, please remember to call function GraphicsObject::Release to release it when no use.

◆ GetFillMode()

common::FillMode foxit::pdf::graphics::PathObject::GetFillMode ( ) const

Get fill mode.

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

◆ GetPathData()

common::Path foxit::pdf::graphics::PathObject::GetPathData ( ) const

Get the path data.

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.

◆ GetStrokeState()

bool foxit::pdf::graphics::PathObject::GetStrokeState ( ) const

Get stroke state.

Returns
true means current path graphics object is stroked, and false means current path graphics object is not stroked.

◆ SetFillMode()

void foxit::pdf::graphics::PathObject::SetFillMode ( common::FillMode  fill_mode)

Set fill mode.

Parameters
[in]fill_modeFill mode. Please refer to values starting from common::e_FillModeNone 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.

◆ SetPathData()

void foxit::pdf::graphics::PathObject::SetPathData ( const common::Path path_data)

Set the path data.

Parameters
[in]path_dataA valid path object which represents the path data to be set.
Returns
None.
Note
When this function succeeds, function GraphicsObjects::GenerateContent should be called. Please refer to function GraphicsObjects::GenerateContent for more details.

◆ SetStrokeState()

void foxit::pdf::graphics::PathObject::SetStrokeState ( bool  is_stroke)

Set stroke state.

Parameters
[in]is_stroketrue means current path graphics object is to be stroked. false means current path graphics object is not to be stroked.
Returns
None.
Note
When this function succeeds, function GraphicsObjects::GenerateContent should be called. Please refer to function GraphicsObjects::GenerateContent for more details.