PdfPath class
Namespace: PdfNetStack.Drawing
Assembly: PdfNetStack.dll
Package: PdfNetStack
A shape made of straight and curved segments, in canvas coordinates (origin top left, y down). Build it, then draw, fill or clip with it through PdfGraphics.
public sealed class PdfPathInheritance
Properties
Section titled “Properties”CurrentPoint
Section titled “ CurrentPoint”The end of the last segment, or null before the first.
public PdfPoint? CurrentPoint { get; }Property Value
Section titled “Property Value”FillRule
Section titled “ FillRule”Fill rule used when the path is filled or used as a clip. Default nonzero.
public PdfFillRule FillRule { get; set; }Property Value
Section titled “Property Value”IsEmpty
Section titled “ IsEmpty”True when nothing has been added.
public bool IsEmpty { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”AddArc(double, double, double, double, double, double)
Section titled “ AddArc(double, double, double, double, double, double)”Adds an elliptical arc. Angles are in degrees from the positive x axis, clockwise on the canvas. When the path has a current point, a line joins it to the arc’s start.
public PdfPath AddArc(double centerX, double centerY, double radiusX, double radiusY, double startAngle, double sweepAngle)Parameters
Section titled “Parameters”centerX double
centerY double
radiusX double
radiusY double
startAngle double
sweepAngle double
Returns
Section titled “Returns”AddCircle(double, double, double)
Section titled “ AddCircle(double, double, double)”Adds a closed circle.
public PdfPath AddCircle(double centerX, double centerY, double radius)Parameters
Section titled “Parameters”centerX double
centerY double
radius double
Returns
Section titled “Returns”AddEllipse(double, double, double, double)
Section titled “ AddEllipse(double, double, double, double)”Adds a closed ellipse inscribed in the given rectangle.
public PdfPath AddEllipse(double x, double y, double width, double height)Parameters
Section titled “Parameters”x double
y double
width double
height double
Returns
Section titled “Returns”AddPolygon(IEnumerable<PdfPoint>, bool)
Section titled “ AddPolygon(IEnumerable<PdfPoint>, bool)”Adds a polygon through the given points, closed unless close is false.
public PdfPath AddPolygon(IEnumerable<PdfPoint> points, bool close = true)Parameters
Section titled “Parameters”points IEnumerable<PdfPoint>
close bool
Returns
Section titled “Returns”AddRectangle(double, double, double, double)
Section titled “ AddRectangle(double, double, double, double)”Adds a closed rectangle with its top left corner at (x, y).
public PdfPath AddRectangle(double x, double y, double width, double height)Parameters
Section titled “Parameters”x double
y double
width double
height double
Returns
Section titled “Returns”AddRoundedRectangle(double, double, double, double, double)
Section titled “ AddRoundedRectangle(double, double, double, double, double)”Adds a closed rectangle with the same circular radius on every corner.
public PdfPath AddRoundedRectangle(double x, double y, double width, double height, double radius)Parameters
Section titled “Parameters”x double
y double
width double
height double
radius double
Returns
Section titled “Returns”AddRoundedRectangle(double, double, double, double, PdfCornerRadii)
Section titled “ AddRoundedRectangle(double, double, double, double, PdfCornerRadii)”Adds a closed rectangle with elliptical corners. Radii that do not fit are scaled down together, as CSS border-radius specifies, so adjacent corners never overlap.
public PdfPath AddRoundedRectangle(double x, double y, double width, double height, PdfCornerRadii radii)Parameters
Section titled “Parameters”x double
y double
width double
height double
radii PdfCornerRadii
Returns
Section titled “Returns”Close()
Section titled “ Close()”Closes the current subpath with a straight line back to its start.
public PdfPath Close()Returns
Section titled “Returns”CurveTo(double, double, double, double, double, double)
Section titled “ CurveTo(double, double, double, double, double, double)”A cubic Bezier curve to (x, y) with two control points.
public PdfPath CurveTo(double x1, double y1, double x2, double y2, double x, double y)Parameters
Section titled “Parameters”x1 double
y1 double
x2 double
y2 double
x double
y double
Returns
Section titled “Returns”LineTo(double, double)
Section titled “ LineTo(double, double)”A straight line to (x, y).
public PdfPath LineTo(double x, double y)Parameters
Section titled “Parameters”x double
y double
Returns
Section titled “Returns”MoveTo(double, double)
Section titled “ MoveTo(double, double)”Starts a new subpath at (x, y).
public PdfPath MoveTo(double x, double y)Parameters
Section titled “Parameters”x double
y double
Returns
Section titled “Returns”QuadraticCurveTo(double, double, double, double)
Section titled “ QuadraticCurveTo(double, double, double, double)”A quadratic Bezier curve to (x, y) with one control point.
public PdfPath QuadraticCurveTo(double cx, double cy, double x, double y)Parameters
Section titled “Parameters”cx double
cy double
x double
y double