Foxit PDF SDK
fsdk.Path Class Reference

Public Member Functions

def AppendEllipse (rect)
 Add an ellipse figure to the end of current path. More...
 
def AppendRect (rect)
 Add a rectangle figure to the end of current path. More...
 
def Clear ()
 Clear all points. More...
 
def CloseFigure ()
 Close current figure (which is also the last figure in current path). More...
 
def CubicBezierTo (point1, point2, point3)
 Add a cubic bezier spline to the end of current figure, by three points: two control points and one target point. More...
 
def GetPoint (index)
 Get a point specified by index. More...
 
def GetPointCount ()
 Get the count of points. More...
 
def GetPointType (index)
 Get the type of a point specified by index. More...
 
def IncreasePointCount (count)
 Increase the point count and prepare adequate memory for these new points. More...
 
def IsEmpty ()
 Check whether current object is empty or not. More...
 
def LineTo (point)
 Add a point to the end of current figure, and a line is to be drawn from current point to the new point. More...
 
def MoveTo (point)
 Add a point to the end of current path, to start a new figure. More...
 
def RemovePoint (index)
 Remove a point specified by index. More...
 
def SetPoint (index, point, type)
 Change the value and type of a point specified by index. More...
 
def Transform (matrix)
 Transform all points in current path with a given matrix. More...
 

Detailed Description

This class represents a path which contains one or more figures.

Member Function Documentation

◆ AppendEllipse()

def fsdk.Path.AppendEllipse (   rect)

Add an ellipse figure to the end of current path.

Parameters
[in]rectThe enclosing rectangle of an ellipse figure.
Returns
true means success, while false means failure.

◆ AppendRect()

def fsdk.Path.AppendRect (   rect)

Add a rectangle figure to the end of current path.

Parameters
[in]rectA rectangle which specifies a rectangle figure.
Returns
true means success, while false means failure.

◆ Clear()

def fsdk.Path.Clear ( )

Clear all points.

Returns
None.

◆ CloseFigure()

def fsdk.Path.CloseFigure ( )

Close current figure (which is also the last figure in current path).

When closing current figure, the last point's type may be changed:

Returns
true means success, while false means failure.

◆ CubicBezierTo()

def fsdk.Path.CubicBezierTo (   point1,
  point2,
  point3 
)

Add a cubic bezier spline to the end of current figure, by three points: two control points and one target point.

If this function succeeds, parameter point3 will become the new "current point".

Parameters
[in]point1New point as the first control point for cubic bezier, in [PDF coordinate system] ().
[in]point2New point as the second control point for cubic bezier, in [PDF coordinate system] ().
[in]point3New point as target point for cubic bezier, in [PDF coordinate system] ().
Returns
true means success, while false means failure.

◆ GetPoint()

def fsdk.Path.GetPoint (   index)

Get a point specified by index.

Parameters
[in]indexThe index of the point. Valid range: 0 to (count-1). count is returned by function fsdk.Path.GetPointCount .
Returns
The specified point.

◆ GetPointCount()

def fsdk.Path.GetPointCount ( )

Get the count of points.

Returns
The count of points.

◆ GetPointType()

def fsdk.Path.GetPointType (   index)

Get the type of a point specified by index.

Parameters
[in]indexThe index of the point. Valid range: 0 to (count-1). count is returned by function fsdk.Path.GetPointCount .
Returns
The type of specified point. Please refer to values starting from fsdk.PathE_TypeMoveTo and this would be one of these values.

◆ IncreasePointCount()

def fsdk.Path.IncreasePointCount (   count)

Increase the point count and prepare adequate memory for these new points.

This function will allocate more memory for given point count and initialize these new points with point (0, 0) and type fsdk.PathE_TypeMoveTo by default. After calling this function successfully, user can use function fsdk.Path.SetPoint to set these new points.

Parameters
[in]countThe new point count. It should not be negative.
Returns
None.

◆ IsEmpty()

def fsdk.Path.IsEmpty ( )

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.

◆ LineTo()

def fsdk.Path.LineTo (   point)

Add a point to the end of current figure, and a line is to be drawn from current point to the new point.

If this function succeeds, the new point will become the new "current point".

Parameters
[in]pointNew point, in [PDF coordinate system] ().
Returns
true means success, while false means failure.

◆ MoveTo()

def fsdk.Path.MoveTo (   point)

Add a point to the end of current path, to start a new figure.

If this function succeeds, the new point will become the new "current point", and the new figure will become the new "current figure".

Parameters
[in]pointNew point, in [PDF coordinate system] ().
Returns
true means success, while false means failure.

◆ RemovePoint()

def fsdk.Path.RemovePoint (   index)

Remove a point specified by index.

Parameters
[in]indexThe index of the point to be removed. Valid range: 0 to (count-1). count is returned by function fsdk.Path.GetPointCount .
Returns
true means success, while false means failure.

◆ SetPoint()

def fsdk.Path.SetPoint (   index,
  point,
  type 
)

Change the value and type of a point specified by index.

Parameters
[in]indexThe index of the point. Valid range: 0 to (count-1). count is returned by function fsdk.Path.GetPointCount .
[in]pointThe new point to set, in [PDF coordinate system] ().
[in]typeThe type used to set to the new point. Please refer to values starting from fsdk.PathE_TypeMoveTo and this should be one of these values.
Returns
true means success, while false means failure.

◆ Transform()

def fsdk.Path.Transform (   matrix)

Transform all points in current path with a given matrix.

Parameters
[in]matrixA matrix used for transforming.
Returns
None.