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
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.
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