# Popup Annotation

A **Popup annotation** displays a pop-up window containing text associated with a parent annotation, such as a [Text](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/annotations/text), [Line](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/annotations/line), [TextMarkup](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/annotations/text-markup), or [Stamp](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/annotations/stamp) annotation. When closed, a popup annotation is invisible. When open, it appears as a pop-up window at a specified location on the page.

The `PopupAnnotation` class is a derivative of the `Annotation` class and it exposes the following properties:

| Property           | Description                                                                                                                                                                                               |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ParentAnnotation` | Gets or sets the parent [MarkupAnnotation](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/annotations/overview) that this popup is associated with. |
| `IsOpen`           | Gets or sets a value indicating whether the popup is initially open.                                                                                                                                      |

## Creating a PopupAnnotation

Popup annotations are typically created in association with another markup annotation, such as Text, Line, TextMarkup, or Stamp. The following example shows how to create a `PopupAnnotation` associated with a `TextAnnotation`:

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

TextAnnotation textAnnotation = page.Annotations.AddText(new Rect(100, 100, 200, 200));
textAnnotation.Contents = "Test text";

PopupAnnotation popupAnnotation = page.Annotations.AddPopup(textAnnotation);
popupAnnotation.IsOpen = true;
```

The popup annotation displays the contents of the text annotation in a pop-up window.

## Creating a PopupAnnotation with FixedContentEditor

When you create a `TextAnnotation` with the [FixedContentEditor](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/fixedcontenteditor) `DrawTextAnnotation` method, you can also associate a popup annotation by setting the `addPopup` parameter to `true`:

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

editor.Position.Translate(100, 100);
Size annotationSize = new Size(50, 50);
Size popupSize = new Size(250, 100);
string text = "This is a TextAnnotation";
bool addPopup = true;

editor.DrawTextAnnotation(annotationSize, popupSize, text, addPopup);

// Access the created popup annotation if needed
PopupAnnotation popupAnnotation = fixedDocument.Pages[0].Annotations[1] as PopupAnnotation;
```

This code creates a [TextAnnotation](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/annotations/text) with an associated `PopupAnnotation`. The popup displays the text provided in the method call.

## See Also

* [Annotations Overview](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/annotations/overview)
* [Text Annotation](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/annotations/text)
* [Line Annotation](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/annotations/line)
* [TextMarkup Annotation](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/annotations/text-markup)
* [Stamp Annotation](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/annotations/stamp)
* [FixedContentEditor](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/fixedcontenteditor)
