-
Notifications
You must be signed in to change notification settings - Fork 1
2.24 Sticky Notes or Text Annotations
The PDF reference document defines Sticky Notes or Text Annotation in Section 8.4 page 621. “A text annotation represents a “sticky note” attached to a point in the PDF document. When closed, the annotation appears as an icon; when open, it displays a pop-up window containing the text of the note in a font and size chosen by the viewer application. Text annotations do not scale and rotate with the page; they behave as if the NoZoom and NoRotate annotation flags (see Table 8.16 on page 608) were always set. Table 8.23 shows the annotation dictionary entries specific to this type of annotation.”
Adding a sticky note to your document is very simple. You add one single line of code. The sticky note is added to a PdfPage
object. It is not part of the page contents. The position of the sticky note is an absolute page location measured from the bottom left corner of the page to the top left corner of the sticky note icon. The text string is the content of the pop-up window. The stick note argument is one of enumeration items below.
// sticky note text annotation
Page.AddStickyNote(PageAbsPosX, PageAbsPosY, "My first sticky note", StickyNoteIcon.Note);
// Sticky note icon
public enum StickyNoteIcon
{
// Comment (note: no icon)
Comment,
// Key
Key,
// Note (default)
Note,
// Help
Help,
// New paragraph
NewParagraph,
// Paragraph
Paragraph,
// Insert
Insert,
}
This page is a copy from https://www.codeproject.com/Articles/570682/PDF-File-Writer-Csharp-Class-Library by Uzi Granot. The article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL). All rights to the texts and source code remain with Uzi Granot.