Skip to content

PDFPath

Namespace: O2S.Components.PDF4NET.Graphics

Defines a PDF path.

public class PDFPath

Inheritance ObjectPDFPath

Remarks

A path represents a series of connected lines and curves.

Constructors

PDFPath()

Initializes a new PDFPath object.

public PDFPath()

Methods

AddArc(Double, Double, Double, Double, Double, Double)

Adds an arc to path.

public void AddArc(double left, double top, double width, double height, double startAngle, double sweepAngle)

Parameters

left Double
x position of rectangle's top left corner.

top Double
y position of rectangle's top left corner.

width Double
The rectangle width.

height Double
The rectangle height.

startAngle Double
Angle in degrees measured clockwise from the x-axis to the starting point of the arc.

sweepAngle Double
Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc.

Remarks

The arc defines an open subpath.


AddArcFromCurrentPoint(Double, Double, Double, Double, Double, Double, Boolean)

Adds an arc to path, used only for drawing clouds.

public void AddArcFromCurrentPoint(double left, double top, double width, double height, double startAngle, double sweepAngle, bool fromCurrentPoint)

Parameters

left Double
x position of rectangle's top left corner.

top Double
y position of rectangle's top left corner.

width Double
The rectangle width.

height Double
The rectangle height.

startAngle Double
Angle in degrees measured clockwise from the x-axis to the starting point of the arc.

sweepAngle Double
Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc.

fromCurrentPoint Boolean
True if the arc starts from current path point.

Remarks

The arc defines an open subpath.


AddBezierTo(Double, Double, Double, Double, Double, Double)

Adds a cubic Berzier curve to current subpath.

public void AddBezierTo(double x1, double y1, double x2, double y2, double x3, double y3)

Parameters

x1 Double
x position of 1st point.

y1 Double
y position of 1st point.

x2 Double
x position of 2nd point.

y2 Double
y position of 2nd point.

x3 Double
x position of 3rd point.

y3 Double
y position of 3rd point.


AddEllipse(Double, Double, Double, Double)

Adds an ellipse to path.

public void AddEllipse(double left, double top, double width, double height)

Parameters

left Double
x position of ellipse's top left corner.

top Double
y position of ellipse's top left corner.

width Double
The ellipse width.

height Double
The ellipse height.

Remarks

The ellipse defines a closed subpath.


AddLineTo(Double, Double)

Adds a line at the end of current subpath.

public void AddLineTo(double x, double y)

Parameters

x Double
x position of the line ending point.

y Double
y position of the line ending point.


AddPath(PDFPath)

Adds a path at the end of current path.

public void AddPath(PDFPath path)

Parameters

path PDFPath
Path to add to current path

Remarks

After calling this method the current point is undefined, a new sub path should be started using PDFPath.StartSubpath(Double, Double) method.


AddPolyBezierTo(PDFPoint[])

Adds a series of connected Bezier curves to current subpath.

public void AddPolyBezierTo(PDFPoint[] points)

Parameters

points PDFPoint[]
An array of points that define the Bezier curves.

Exceptions

ArgumentNullException
Thrown when points parameter is null.

Remarks

Each Bezier curve is defined by 4 points. The first curve uses the current point as its first control point and each following curve uses the last point of the previous curve as its first control point.
The last point in the array becomes the new current point in the path.


AddPolygon(PDFPoint[])

Adds a polygon to path.

public void AddPolygon(PDFPoint[] points)

Parameters

points PDFPoint[]
An array of points that define the polygon vertices.

Remarks

The polygon defines a closed subpath.


AddPolyLineTo(PDFPoint[])

Adds a series of connected lines at the end of current subpath.

public void AddPolyLineTo(PDFPoint[] points)

Parameters

points PDFPoint[]
An array of points that define the lines.


AddRectangle(Double, Double, Double, Double)

Adds a rectangle to path.

public void AddRectangle(double left, double top, double width, double height)

Parameters

left Double
x position of rectangle's top left corner.

top Double
y position of rectangle's top left corner.

width Double
The rectangle width.

height Double
The rectangle height.

Remarks

The rectangle defines a closed subpath.


AddRoundRectangle(Double, Double, Double, Double, Double, Double)

Adds a rounded rectangle to path.

public void AddRoundRectangle(double left, double top, double width, double height, double ellipseWidth, double ellipseHeight)

Parameters

left Double
x position of rectangle's top left corner.

top Double
y position of rectangle's top left corner.

width Double
The rectangle width.

height Double
The rectangle height.

ellipseWidth Double
The width of the ellipse that defines the rectangle corners.

ellipseHeight Double
The height of the ellipse that defines the rectangle corners.

Remarks

The round rectangle defines a closed subpath.


CloseSubpath()

Closes the current subpath.

public void CloseSubpath()

Remarks

A new subpath can be started using PDFPath.StartSubpath(Double, Double) method.


StartSubpath(Double, Double)

Creates a new subpath at the given position.

public void StartSubpath(double x, double y)

Parameters

x Double
x position of the new subpath.

y Double
y position of the new subpath.

Remarks

This method ends the previous subpath..