Skip to main content
A newer version of this page is available. .
All docs
V20.2

PdfViewer.AddStickyNote(PdfDocumentPosition, String, Color) Method

Creates a text annotations (sticky note) at the specified document position with the specified comment and color.

Namespace: DevExpress.XtraPdfViewer

Assembly: DevExpress.XtraPdfViewer.v20.2.dll

NuGet Package: DevExpress.Win.PdfViewer

Declaration

public void AddStickyNote(
    PdfDocumentPosition position,
    string comment,
    Color color
)

Parameters

Name Type Description
position PdfDocumentPosition

The position of the sticky note on the page.

comment String

The annotation comment.

color Color

The annotation color.

Remarks

The AddStickyNote method calls triggers the PdfViewer.AnnotationCreating event.

The code below highlights the selected text and adds a sticky note.

View Example: How to create a text markup annotation

using System.Drawing;
using System.Windows.Forms;

namespace CreateMarkupAnnotation
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            // Load a document.
            pdfViewer.LoadDocument("..\\..\\Demo.pdf");

            // Select the text where the markup annotation will be created:
            pdfViewer.FindText("PDF Viewer");

            // Highlight selected text.
            pdfViewer.HighlightSelectedText();

            pdfViewer.AddStickyNote
            (new PdfDocumentPosition(1, new PdfPoint(29, 568)),
             "Comment", Color.Crimson);
        }
    }
}
See Also