# Path

`Path` is a content element that represents a series of connected lines and curves. The [Geometry](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/concepts/geometry) property specifies the shape of the path.

* [Inserting a Path](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/path#inserting-a-path)
* [Modifying a Path](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/path#modifying-a-path)

## Public API

| **Property**          | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Fill`                | The color that fills the path. The default value is Black.                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `Stroke`              | The color that strokes the path. The default value is Black.                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `IsFilled`            | Specifies whether the path is filled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `IsStroked`           | Specifies whether the path is stroked.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `StrokeThickness`     | The width of the stroke outline.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `StrokeLineCap`       | Specifies the shape used at the ends of open paths when they are stroked. It can have one of the following values: <table><tr><th scope="row">`Flat`</th><td>Flat line cap.</td></tr><tr><th scope="row">`Round`</th><td>Round line cap.</td></tr><tr><th scope="row">`Square`</th><td>Square line cap.</td></tr></table>                                                                                                                                                                                        |
| `StrokeLineJoin`      | Specifies the shape used at the corners of stroked paths. Join styles are significant only at points where consecutive segments connect at an angle. Available options: <table><tr><th scope="row">`Bevel`</th><td>Produces a diagonal corner.</td></tr><tr><th scope="row">`Miter`</th><td>Produces a sharp corner. If the segments meet at too sharp an angle, a bevel join is used instead.</td></tr><tr><th scope="row">`Round`</th><td>Produces a smooth, circular arc between the lines.</td></tr></table> |
| `StrokeDashArray`     | The pattern of dashes and gaps used to stroke paths.                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `StrokeDashOffset`    | The distance from the start of a line to the beginning of a dash pattern.                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `AlphaConstant`       | Specifies the constant shape or constant opacity value for nonstroking operations.                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `StrokeAlphaConstant` | Specifies the constant shape or constant opacity value for stroking operations.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `MiterLimit`          | The limit of the thickness of the join on a mitered corner.                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `Geometry`            | The shape to draw. For more information, see [Geometry](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/concepts/geometry).                                                                                                                                                                                                                                                                                                                                       |
| `Position`            | Specifies the position of the path.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

| **Method**                      | **Description**                               |
| ------------------------------- | --------------------------------------------- |
| `Clone` (starting with Q2 2025) | Creates a deep copy of this document element. |

### Inserting a Path

`Path` is a content element designed for the `Content` collection of an `IContainerElement` such as [RadFixedPage](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/radfixedpage). You can use several approaches to add it.

**Example 1** shows how to create a `Path`, assign a predefined `Geometry` to it, and add it to a container.

**Example 1: Create Path and add it to container**

```C#
RadFixedPage container = new RadFixedPage();
Path path1 = new Path();
path1.Geometry = geometry;
container.Content.Add(path1);
```

**Example 2** demonstrates how to use one of the factory methods of the `ContentElementCollection` to create a new path and insert it into the document.

**Example 2: Add Path to container**

```C#
Path path2 = container.Content.AddPath();
path2.Geometry = geometry;
```

> There are other methods that allow adding a path to a document. You can use them through the [FixedContentEditor](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/fixedcontenteditor) class.

### Modifying a Path

You can modify a `Path` element using the properties the class exposes. The properties are listed in the [Public API](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/path#public-api) section.

**Example 3: Modifying Path properties**

```C#
RadFixedDocument document = new RadFixedDocument();
RadFixedPage page = document.Pages.AddPage();
FixedContentEditor editor = new FixedContentEditor(page);

RectangleGeometry rectangleGeometry = new RectangleGeometry();
rectangleGeometry.Rect = new Rect(10, 5, 400, 300);

Path path3 = new Path();
path3.Geometry = rectangleGeometry;

SimplePosition simplePosition = new SimplePosition();
simplePosition.Translate(20, 20);

path3.Fill = new RgbColor(255, 0, 255);
path3.Stroke = new RgbColor(0, 0, 255);
path3.IsFilled = true;
path3.IsStroked = true;
path3.StrokeThickness = 1;
path3.StrokeLineCap = Telerik.Documents.Fixed.Model.Graphics.LineCap.Flat;
path3.StrokeLineJoin = Telerik.Documents.Fixed.Model.Graphics.LineJoin.Round;
path3.StrokeDashArray = new double[] { 1 };
path3.StrokeDashOffset = 2;
path3.AlphaConstant = 0.5;
path3.StrokeAlphaConstant = 0.1;
path3.MiterLimit = 2;
path3.Position = simplePosition;

page.Content.Add(path3);
```

## See Also

* [Geometry](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/concepts/geometry)
* [RadFixedPage](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/radfixedpage)
* [FixedContentEditor](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/fixedcontenteditor)
* [How to Draw Figures in PDF Documents](https://www.telerik.com/document-processing-libraries/documentation/knowledge-base/pdf-processing-draw-figures-arcsegment)
