# Line Annotation

A **Line annotation** displays a single straight line on the page. When opened, it displays a pop-up window containing the text of the associated note.

The `LineAnnotation` class is a derivative of `MarkupAnnotation` (descendent of `ContentAnnotation`) and it exposes the following properties:

| Property              | Description                                                                                                                                                                                                                                                |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Start`               | Gets or sets the starting point of the annotation.                                                                                                                                                                                                         |
| `End`                 | Gets or sets the ending point of the annotation.                                                                                                                                                                                                           |
| `StartLineEndingType` | Gets or sets the line ending type for the start of the line.                                                                                                                                                                                               |
| `EndLineEndingType`   | Gets or sets the line ending type for the end of the line.                                                                                                                                                                                                 |
| `Opacity`             | Gets or sets the opacity of the annotation.                                                                                                                                                                                                                |
| `Contents`            | Gets or sets the text displayed for the annotation.                                                                                                                                                                                                        |
| `Color`               | Gets or sets the color of the annotation.                                                                                                                                                                                                                  |
| `Content`             | Gets the source defining the visual content of the annotation. This content has higher priority compared to the annotation appearance characteristics and text properties and is visualized by default when opening the exported document in a PDF viewer. |

## Creating a LineAnnotation

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

LineAnnotation annotation = page.Annotations.AddLine(new Point(50, 50), new Point(300, 300));
annotation.StartLineEndingType = LineEndingType.None;
annotation.EndLineEndingType = LineEndingType.OpenArrow;
annotation.Color = new RgbColor(255, 0, 0); //Default RgbColor(255, 255, 255)
annotation.Contents = "This is a LineAnnotation";
annotation.Opacity = 0.5;
```

![Create LineAnnotation](https://www.telerik.com/document-processing-libraries/documentation/assets/785aca7cffa1437e9d3350de1cd7bac7/pdf-processing-create-lineannotation.png)

## Creating a LineAnnotation with FixedContentEditor

The [FixedContentEditor](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/fixedcontenteditor) offers the public `DrawLineAnnotation` method which creates a new `LineAnnotation` with a starting point at the current position of the editor and an end point at the current position of the editor plus the given distances.

```C#
RadFixedDocument fixedDocument = new RadFixedDocument();
FixedContentEditor editor = new FixedContentEditor(fixedDocument.Pages.AddPage());

editor.Position.Translate(50, 50);
editor.DrawText("Line starts here.");
editor.DrawLineAnnotation(100, 200);
```

![Create LineAnnotation with FixedContentEditor](https://www.telerik.com/document-processing-libraries/documentation/assets/8a77596328a789122810b0b3e041c62c/pdf-processing-create-lineannotation-with-fixedcontenteditor.png)

## See Also

* [AcroForm](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/interactive-forms/acroform)
* [FormField](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/interactive-forms/form-fields/formfields)
* [Annotations Overview](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/annotations/overview)
