# PdfPath class

> 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...

Namespace: [PdfNetStack.Drawing](https://www.jadev-corp.com/api/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](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfgraphics/).

```csharp
public sealed class PdfPath
```

**Inheritance**

[object](https://learn.microsoft.com/dotnet/api/system.object) ← 
[PdfPath](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpath/)

## Properties

### <a id="PdfNetStack_Drawing_PdfPath_CurrentPoint"></a> CurrentPoint

The end of the last segment, or null before the first.

```csharp
public PdfPoint? CurrentPoint { get; }
```

#### Property Value

 [PdfPoint](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpoint/)?

### <a id="PdfNetStack_Drawing_PdfPath_FillRule"></a> FillRule

Fill rule used when the path is filled or used as a clip. Default nonzero.

```csharp
public PdfFillRule FillRule { get; set; }
```

#### Property Value

 [PdfFillRule](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdffillrule/)

### <a id="PdfNetStack_Drawing_PdfPath_IsEmpty"></a> IsEmpty

True when nothing has been added.

```csharp
public bool IsEmpty { get; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

## Methods

### <a id="PdfNetStack_Drawing_PdfPath_AddArc_System_Double_System_Double_System_Double_System_Double_System_Double_System_Double_"></a> 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.

```csharp
public PdfPath AddArc(double centerX, double centerY, double radiusX, double radiusY, double startAngle, double sweepAngle)
```

#### Parameters

`centerX` [double](https://learn.microsoft.com/dotnet/api/system.double)

`centerY` [double](https://learn.microsoft.com/dotnet/api/system.double)

`radiusX` [double](https://learn.microsoft.com/dotnet/api/system.double)

`radiusY` [double](https://learn.microsoft.com/dotnet/api/system.double)

`startAngle` [double](https://learn.microsoft.com/dotnet/api/system.double)

`sweepAngle` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfPath](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpath/)

### <a id="PdfNetStack_Drawing_PdfPath_AddCircle_System_Double_System_Double_System_Double_"></a> AddCircle\(double, double, double\)

Adds a closed circle.

```csharp
public PdfPath AddCircle(double centerX, double centerY, double radius)
```

#### Parameters

`centerX` [double](https://learn.microsoft.com/dotnet/api/system.double)

`centerY` [double](https://learn.microsoft.com/dotnet/api/system.double)

`radius` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfPath](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpath/)

### <a id="PdfNetStack_Drawing_PdfPath_AddEllipse_System_Double_System_Double_System_Double_System_Double_"></a> AddEllipse\(double, double, double, double\)

Adds a closed ellipse inscribed in the given rectangle.

```csharp
public PdfPath AddEllipse(double x, double y, double width, double height)
```

#### Parameters

`x` [double](https://learn.microsoft.com/dotnet/api/system.double)

`y` [double](https://learn.microsoft.com/dotnet/api/system.double)

`width` [double](https://learn.microsoft.com/dotnet/api/system.double)

`height` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfPath](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpath/)

### <a id="PdfNetStack_Drawing_PdfPath_AddPolygon_System_Collections_Generic_IEnumerable_PdfNetStack_Drawing_PdfPoint__System_Boolean_"></a> AddPolygon\(IEnumerable&lt;PdfPoint\>, bool\)

Adds a polygon through the given points, closed unless <code class="paramref">close</code> is false.

```csharp
public PdfPath AddPolygon(IEnumerable<PdfPoint> points, bool close = true)
```

#### Parameters

`points` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable\-1)<[PdfPoint](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpoint/)\>

`close` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Returns

 [PdfPath](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpath/)

### <a id="PdfNetStack_Drawing_PdfPath_AddRectangle_System_Double_System_Double_System_Double_System_Double_"></a> AddRectangle\(double, double, double, double\)

Adds a closed rectangle with its top left corner at (x, y).

```csharp
public PdfPath AddRectangle(double x, double y, double width, double height)
```

#### Parameters

`x` [double](https://learn.microsoft.com/dotnet/api/system.double)

`y` [double](https://learn.microsoft.com/dotnet/api/system.double)

`width` [double](https://learn.microsoft.com/dotnet/api/system.double)

`height` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfPath](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpath/)

### <a id="PdfNetStack_Drawing_PdfPath_AddRoundedRectangle_System_Double_System_Double_System_Double_System_Double_System_Double_"></a> AddRoundedRectangle\(double, double, double, double, double\)

Adds a closed rectangle with the same circular radius on every corner.

```csharp
public PdfPath AddRoundedRectangle(double x, double y, double width, double height, double radius)
```

#### Parameters

`x` [double](https://learn.microsoft.com/dotnet/api/system.double)

`y` [double](https://learn.microsoft.com/dotnet/api/system.double)

`width` [double](https://learn.microsoft.com/dotnet/api/system.double)

`height` [double](https://learn.microsoft.com/dotnet/api/system.double)

`radius` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfPath](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpath/)

### <a id="PdfNetStack_Drawing_PdfPath_AddRoundedRectangle_System_Double_System_Double_System_Double_System_Double_PdfNetStack_Drawing_PdfCornerRadii_"></a> 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.

```csharp
public PdfPath AddRoundedRectangle(double x, double y, double width, double height, PdfCornerRadii radii)
```

#### Parameters

`x` [double](https://learn.microsoft.com/dotnet/api/system.double)

`y` [double](https://learn.microsoft.com/dotnet/api/system.double)

`width` [double](https://learn.microsoft.com/dotnet/api/system.double)

`height` [double](https://learn.microsoft.com/dotnet/api/system.double)

`radii` [PdfCornerRadii](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfcornerradii/)

#### Returns

 [PdfPath](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpath/)

### <a id="PdfNetStack_Drawing_PdfPath_Close"></a> Close\(\)

Closes the current subpath with a straight line back to its start.

```csharp
public PdfPath Close()
```

#### Returns

 [PdfPath](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpath/)

### <a id="PdfNetStack_Drawing_PdfPath_CurveTo_System_Double_System_Double_System_Double_System_Double_System_Double_System_Double_"></a> CurveTo\(double, double, double, double, double, double\)

A cubic Bezier curve to (x, y) with two control points.

```csharp
public PdfPath CurveTo(double x1, double y1, double x2, double y2, double x, double y)
```

#### Parameters

`x1` [double](https://learn.microsoft.com/dotnet/api/system.double)

`y1` [double](https://learn.microsoft.com/dotnet/api/system.double)

`x2` [double](https://learn.microsoft.com/dotnet/api/system.double)

`y2` [double](https://learn.microsoft.com/dotnet/api/system.double)

`x` [double](https://learn.microsoft.com/dotnet/api/system.double)

`y` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfPath](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpath/)

### <a id="PdfNetStack_Drawing_PdfPath_LineTo_System_Double_System_Double_"></a> LineTo\(double, double\)

A straight line to (x, y).

```csharp
public PdfPath LineTo(double x, double y)
```

#### Parameters

`x` [double](https://learn.microsoft.com/dotnet/api/system.double)

`y` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfPath](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpath/)

### <a id="PdfNetStack_Drawing_PdfPath_MoveTo_System_Double_System_Double_"></a> MoveTo\(double, double\)

Starts a new subpath at (x, y).

```csharp
public PdfPath MoveTo(double x, double y)
```

#### Parameters

`x` [double](https://learn.microsoft.com/dotnet/api/system.double)

`y` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfPath](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpath/)

### <a id="PdfNetStack_Drawing_PdfPath_QuadraticCurveTo_System_Double_System_Double_System_Double_System_Double_"></a> QuadraticCurveTo\(double, double, double, double\)

A quadratic Bezier curve to (x, y) with one control point.

```csharp
public PdfPath QuadraticCurveTo(double cx, double cy, double x, double y)
```

#### Parameters

`cx` [double](https://learn.microsoft.com/dotnet/api/system.double)

`cy` [double](https://learn.microsoft.com/dotnet/api/system.double)

`x` [double](https://learn.microsoft.com/dotnet/api/system.double)

`y` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfPath](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpath/)

## Used in

- [Draw on PDF pages in C# and .NET](https://www.jadev-corp.com/guides/drawing/)

Source: https://www.jadev-corp.com/pdfnetstack/api/pdfnetstack-drawing/pdfpath/
