# Marked Content

| Minimum Version | Q2 2025                                                                                                                                                         |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Related Feature | [Accessibility Support](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/features/accessibility-support/overview) |

Marked-content operators identify a portion of a PDF content stream as a marked-content element of interest to a particular application or PDF plugin extension. A graphics application, for example, can use marked content to identify a set of related objects as a group to be processed as a single unit. A text-processing application can use it to maintain a connection between a footnote marker in the body of a document and the corresponding footnote text at the bottom of the page. The marked-content operators store internally a **tag** operand that indicates the role or significance of the marked-content element to the processing application.

RadPdfProcessing offers the `MarkedContent` class, which represents marked content in a [fixed document](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/radfixedpage).

You can add marked content to a `RadFixedDocument` in the following ways:

## Adding Marked Content Using the PDF Model

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

MarkedContent markedContent = page.Content.AddMarkedContent();
TextFragment markedContent1 = markedContent.Content.AddTextFragment("markedContent1");
markedContent1.Position.Translate(50, 100);

MarkedContent nestedMarkedContent = markedContent.Content.AddMarkedContent();
TextFragment nestedMarkedContentText = nestedMarkedContent.Content.AddTextFragment("nestedMarkedContent");
nestedMarkedContentText.Position.Translate(50, 150);
FormSource formSource = new FormSource();
formSource.Size = new Size(200, 200);
Form form = nestedMarkedContent.Content.AddForm(formSource);
//Fill the form 
TextFragment markedContent2 = markedContent.Content.AddTextFragment("markedContent2");
markedContent2.Position.Translate(50, 200);
```

## Adding Marked Content Using the FixedContentEditor

```C#
RadFixedDocument fixedDocument = new RadFixedDocument();
RadFixedPage page = fixedDocument.Pages.AddPage();
FixedContentEditor editor = new FixedContentEditor(page);
MarkedContent markedContent1 = new MarkedContent();
markedContent1.Content.AddTextFragment("marked content text 1");
editor.Position.Translate(50, 50);
editor.Draw(markedContent1);

MarkedContent markedContent2 = new MarkedContent();
markedContent2.Content.AddTextFragment("marked content text 2");
editor.Position.Translate(0, 200);
editor.Draw(markedContent2);
```

## Adding Marked Content Using the RadFixedDocumentEditor

```C#
RadFixedDocument fixedDocument = new RadFixedDocument();
RadFixedPage page = fixedDocument.Pages.AddPage();
using (RadFixedDocumentEditor editor = new RadFixedDocumentEditor(fixedDocument))
{
    MarkedContent markedContent = new MarkedContent();
    TextFragment markedContent1 = markedContent.Content.AddTextFragment("markedContent1");
    markedContent1.Position.Translate(50, 100);

    editor.InsertMarkedContent(markedContent);
}
```

## Adding Marked Content Using the Block

```C#
RadFixedDocument fixedDocument = new RadFixedDocument();
RadFixedPage page = fixedDocument.Pages.AddPage();
using (RadFixedDocumentEditor editor = new RadFixedDocumentEditor(fixedDocument))
{
    Block block = new Block();
    block.InsertMarkedContentStart();
    block.InsertText("first");
    block.InsertMarkedContentStart();
    block.InsertText("second");
    block.InsertMarkedContentEnd();
    block.InsertMarkedContentEnd();

    editor.InsertBlock(block);
}
```

## See Also

* [Block](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/block)
* [RadFixedDocumentEditor](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/radfixeddocumenteditor)
* [FixedContentEditor](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/fixedcontenteditor)
* [Tagged PDF](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/tagged-pdf)
* [StructureTree](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/structure-tree)
