Available for: UI for ASP.NET MVC | UI for ASP.NET AJAX | UI for Blazor | UI for WPF | UI for WinForms | UI for Silverlight | UI for Xamarin | UI for WinUI | UI for ASP.NET Core | UI for .NET MAUI

New to Telerik Document Processing? Download free 30-day trial

Marked Content

Marked-content operators identify a portion of a PDF content stream as a marked-content element of interest to a particular application or PDF plug-in extension. A graphics application, for example, might use marked content to identify a set of related objects as a group to be processed as a single unit. A text-processing application might 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 are expected to store internally a tag operand indicating the role or significance of the marked-content element to the processing application.

As of Q2 2025 RadPdfProcessing offers the MarkedContent class which represents marked content in a fixed document.

There are different possibilities for adding marked content to a RadFixedDocument:

Adding Marked Content using the PDF Model

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

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

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

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

In this article