WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfPopupAnnotation

    Show / Hide Table of Contents

    Class PdfPopupAnnotation

    Represents a base class for popup annotation which can be either in open or closed state.

    Inheritance
    System.Object
    PdfAnnotation
    PdfPopupAnnotation
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    PdfAnnotation.SetAppearance(Boolean)
    PdfAnnotation.CalculateBounds(RectangleF, PdfPage, PdfLoadedPage)
    PdfAnnotation.SetValues(String, String)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean, PdfGraphics)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean)
    PdfAnnotation.CheckFlatten()
    PdfAnnotation.Color
    PdfAnnotation.Opacity
    PdfAnnotation.InnerColor
    PdfAnnotation.Border
    PdfAnnotation.Bounds
    PdfAnnotation.Location
    PdfAnnotation.Size
    PdfAnnotation.Page
    PdfAnnotation.Text
    PdfAnnotation.Author
    PdfAnnotation.Subject
    PdfAnnotation.ModifiedDate
    PdfAnnotation.AnnotationFlags
    PdfAnnotation.Flatten
    PdfAnnotation.FlattenPopUps
    PdfAnnotation.PdfTag
    PdfAnnotation.Layer
    PdfAnnotation.Rotate
    PdfAnnotation.Name
    PdfAnnotation.PropertyChanged
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfPopupAnnotation : PdfAnnotation, IPdfWrapper, INotifyPropertyChanged
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page .
    PdfPage page = document.Pages.Add();
    //Create a new rectangle
    RectangleF rectangle = new RectangleF(10, 40, 30, 30);
    //Create a new popup annotation.
    PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(rectangle, "Test popup annotation");
    popupAnnotation.Border.Width = 4;
    popupAnnotation.Border.HorizontalRadius = 20;
    popupAnnotation.Border.VerticalRadius = 30;
    //Set the pdf popup icon.
    popupAnnotation.Icon = PdfPopupIcon.NewParagraph;
    //Add this annotation to a new page.
    page.Annotations.Add(popupAnnotation);
    //Save the document to disk.
    document.Save("Output.pdf");
    //close the document
    document.Close(true);
    'Create a new PDF document.
    Dim document As New PdfDocument()
    'Create a new page .
    Dim page As PdfPage = document.Pages.Add()
    'Create a new rectangle
    Dim rectangle As New RectangleF(10, 40, 30, 30)
    'Create a new popup annotation.
    Dim popupAnnotation As New PdfPopupAnnotation(rectangle, "Test popup annotation")
    popupAnnotation.Border.Width = 4
    popupAnnotation.Border.HorizontalRadius = 20
    popupAnnotation.Border.VerticalRadius = 30
    'Set the pdf popup icon.
    popupAnnotation.Icon = PdfPopupIcon.NewParagraph
    'Add this annotation to a new page.
    page.Annotations.Add(popupAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'close the document
    document.Close(True)

    Constructors

    PdfPopupAnnotation()

    Initializes a new instance of the PdfPopupAnnotation class.

    Declaration
    public PdfPopupAnnotation()
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page.
    PdfPage page = document.Pages.Add();
    //Create a new rectangle
    RectangleF rectangle = new RectangleF(10, 40, 30, 30);
    //Create a new popup annotation.
    PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation();
    popupAnnotation.Text = "Test popup annotation";
    popupAnnotation.Bounds = rectangle;
    popupAnnotation.Border.Width = 4;
    popupAnnotation.Border.HorizontalRadius = 20;
    popupAnnotation.Border.VerticalRadius = 30;
    //Set the pdf popup icon.
    popupAnnotation.Icon = PdfPopupIcon.NewParagraph;
    //Add this annotation to a new page.
    page.Annotations.Add(popupAnnotation);
    //Save the document to disk.
    document.Save("Output.pdf");
    //close the document
    document.Close(true);
    'Create a new PDF document.
    Dim document As New PdfDocument()
    'Create a new page.
    Dim page As PdfPage = document.Pages.Add()
    'Create a new rectangle
    Dim rectangle As New RectangleF(10, 40, 30, 30)
    'Create a new popup annotation.
    Dim popupAnnotation As New PdfPopupAnnotation()
    popupAnnotation.Text = "Test popup annotation"
    popupAnnotation.Bounds = rectangle
    popupAnnotation.Border.Width = 4
    popupAnnotation.Border.HorizontalRadius = 20
    popupAnnotation.Border.VerticalRadius = 30
    'Set the pdf popup icon.
    popupAnnotation.Icon = PdfPopupIcon.NewParagraph
    'Add this annotation to a new page.
    page.Annotations.Add(popupAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'close the document
    document.Close(True)

    PdfPopupAnnotation(RectangleF)

    Initializes a new instance of the PdfPopupAnnotation class with specified bounds.

    Declaration
    public PdfPopupAnnotation(RectangleF rectangle)
    Parameters
    Type Name Description
    System.Drawing.RectangleF rectangle

    RectangleF structure that specifies the bounds of the annotation.

    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page .
    PdfPage page = document.Pages.Add();
    //Create a new rectangle
    RectangleF rectangle = new RectangleF(10, 40, 30, 30);
    //Create a new popup annotation.
    PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(rectangle);
    popupAnnotation.Text = "Test popup annotation";
    popupAnnotation.Border.Width = 4;
    popupAnnotation.Border.HorizontalRadius = 20;
    popupAnnotation.Border.VerticalRadius = 30;
    //Set the pdf popup icon.
    popupAnnotation.Icon = PdfPopupIcon.NewParagraph;
    //Add this annotation to a new page.
    page.Annotations.Add(popupAnnotation);
    //Save the document to disk.
    document.Save("Output.pdf");
    //close the document
    document.Close(true);
    'Create a new PDF document.
    Dim document As New PdfDocument()
    'Create a new page .
    Dim page As PdfPage = document.Pages.Add()
    'Create a new rectangle
    Dim rectangle As New RectangleF(10, 40, 30, 30)
    'Create a new popup annotation.
    Dim popupAnnotation As New PdfPopupAnnotation(rectangle)
    popupAnnotation.Text = "Test popup annotation"
    popupAnnotation.Border.Width = 4
    popupAnnotation.Border.HorizontalRadius = 20
    popupAnnotation.Border.VerticalRadius = 30
    'Set the pdf popup icon.
    popupAnnotation.Icon = PdfPopupIcon.NewParagraph
    'Add this annotation to a new page.
    page.Annotations.Add(popupAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'close the document
    document.Close(True)

    PdfPopupAnnotation(RectangleF, String)

    Initializes a new instance of the PdfPopupAnnotation class with specified bounds and annotation text.

    Declaration
    public PdfPopupAnnotation(RectangleF rectangle, string text)
    Parameters
    Type Name Description
    System.Drawing.RectangleF rectangle

    RectangleF structure that specifies the bounds of the annotation.

    System.String text

    The string specifies the annotation text.

    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page .
    PdfPage page = document.Pages.Add();
    //Create a new rectangle
    RectangleF rectangle = new RectangleF(10, 40, 30, 30);
    //Create a new popup annotation.
    PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(rectangle, "Test popup annotation");
    popupAnnotation.Border.Width = 4;
    popupAnnotation.Border.HorizontalRadius = 20;
    popupAnnotation.Border.VerticalRadius = 30;
    //Set the pdf popup icon.
    popupAnnotation.Icon = PdfPopupIcon.NewParagraph;
    //Add this annotation to a new page.
    page.Annotations.Add(popupAnnotation);
    //Save the document to disk.
    document.Save("Output.pdf");
    //close the document
    document.Close(true);
    'Create a new PDF document.
    Dim document As New PdfDocument()
    'Create a new page .
    Dim page As PdfPage = document.Pages.Add()
    'Create a new rectangle
    Dim rectangle As New RectangleF(10, 40, 30, 30)
    'Create a new popup annotation.
    Dim popupAnnotation As New PdfPopupAnnotation(rectangle, "Test popup annotation")
    popupAnnotation.Border.Width = 4
    popupAnnotation.Border.HorizontalRadius = 20
    popupAnnotation.Border.VerticalRadius = 30
    'Set the pdf popup icon.
    popupAnnotation.Icon = PdfPopupIcon.NewParagraph
    'Add this annotation to a new page.
    page.Annotations.Add(popupAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'close the document
    document.Close(True)

    Properties

    Appearance

    Declaration
    public PdfAppearance Appearance { get; set; }
    Property Value
    Type Description
    PdfAppearance

    Comments

    Gets the annotation comments

    Declaration
    public PdfPopupAnnotationCollection Comments { get; }
    Property Value
    Type Description
    PdfPopupAnnotationCollection
    Examples
    PdfDocument doc = new PdfDocument();
    PdfPage page = doc.Pages.Add();
    //Creates a rectangle
    RectangleF rectangle = new RectangleF(10, 40, 30, 30);
    //Creates a new popup annotation.
    PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(rectangle, "Test popup annotation");
    popupAnnotation.Border.Width = 4;
    popupAnnotation.Border.HorizontalRadius = 20;
    popupAnnotation.Border.VerticalRadius = 30;
    //Sets the pdf popup icon.
    popupAnnotation.Icon = PdfPopupIcon.NewParagraph;
    //set comments
    PdfPopupAnnotation popupComments = new PdfPopupAnnotation();
    popupComments.Author = "TestAuthor";
    popupComments.Text = "Test Text";
    popupAnnotation.Comments.Add(popupComments);
    //Get annotation comments
    PdfPopupAnnotationCollection commentsCollection = popupAnnotation.Comments;
    //Saves the document to disk.
    doc.Save("Output.pdf");
    doc.Close(true);
    Dim doc As PdfDocument = New PdfDocument
    Dim page As PdfPage = doc.Pages.Add
    Dim rectangle As RectangleF = New RectangleF(10, 40, 30, 30)
    Dim popupAnnotation As PdfPopupAnnotation = New PdfPopupAnnotation(rectangle, "Test popup annotation")
    popupAnnotation.Border.Width = 4
    popupAnnotation.Border.HorizontalRadius = 20
    popupAnnotation.Border.VerticalRadius = 30
    'Sets the pdf popup icon.
    popupAnnotation.Icon = PdfPopupIcon.NewParagraph
    Dim popupComments As PdfPopupAnnotation = New PdfPopupAnnotation
    popupComments.Author = "TestAuthor"
    popupComments.Text = "Test Text"
    popupAnnotation.Comments.Add(popupComments)
    Dim commentsCollection As PdfPopupAnnotationCollection = popupAnnotation.Comments
    'Saves the document to disk.
    doc.Save("Output.pdf")
    doc.Close(true)

    Icon

    Declaration
    public PdfPopupIcon Icon { get; set; }
    Property Value
    Type Description
    PdfPopupIcon

    Open

    Gets or sets value whether annotation is initially open or closed.

    Declaration
    public bool Open { get; set; }
    Property Value
    Type Description
    System.Boolean
    Examples

    True if the annotation is intially open, otherwise false.

    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page .
    PdfPage page = document.Pages.Add();
    //Create a new rectangle
    RectangleF rectangle = new RectangleF(10, 40, 30, 30);
    //Create a new popup annotation.
    PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(rectangle, "Test popup annotation");
    //Set the Open to popupAnnotation.
    popupAnnotation.Open = true;
    //Add this annotation to a new page.
    page.Annotations.Add(popupAnnotation);
    //Save the document to disk.
    document.Save("Output.pdf");
    //close the document
    document.Close(true);
    'Create a new PDF document.
    Dim document As New PdfDocument()
    'Create a new page .
    Dim page As PdfPage = document.Pages.Add()
    'Create a new rectangle
    Dim rectangle As New RectangleF(10, 40, 30, 30)
    'Create a new popup annotation.
    Dim popupAnnotation As New PdfPopupAnnotation(rectangle, "Test popup annotation")
    'Set the Open to popupAnnotation.
    popupAnnotation.Open = True
    'Add this annotation to a new page.
    page.Annotations.Add(popupAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'close the document
    document.Close(True)

    ReviewHistory

    Gets the annotation reviews

    Declaration
    public PdfPopupAnnotationCollection ReviewHistory { get; }
    Property Value
    Type Description
    PdfPopupAnnotationCollection
    Examples
    PdfDocument doc = new PdfDocument();
    PdfPage page = doc.Pages.Add();
    //Creates a rectangle
    RectangleF rectangle = new RectangleF(10, 40, 30, 30);
    //Creates a new popup annotation.
    PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(rectangle, "Test popup annotation");
    popupAnnotation.Border.Width = 4;
    popupAnnotation.Border.HorizontalRadius = 20;
    popupAnnotation.Border.VerticalRadius = 30;
    //Sets the pdf popup icon.
    popupAnnotation.Icon = PdfPopupIcon.NewParagraph;
    //set Reviews
    PdfPopupAnnotation popup = new PdfPopupAnnotation();
    popup.State = PdfAnnotationState.Accepted;
    popup.StateModel = PdfAnnotationStateModel.Review;
    popup.Text = "Hello PDF Comments";
    popupAnnotation.ReviewHistory.Add(popup);
    //Get annotation comments
    PdfPopupAnnotationCollection reviewCollection = popupAnnotation.ReviewHistory;
    //Saves the document to disk.
    doc.Save("Output.pdf");
    doc.Close(true);
    Dim doc As PdfDocument = New PdfDocument
    Dim page As PdfPage = doc.Pages.Add
    Dim rectangle As RectangleF = New RectangleF(10, 40, 30, 30)
    Dim popupAnnotation As PdfPopupAnnotation = New PdfPopupAnnotation(rectangle, "Test popup annotation")
    popupAnnotation.Border.Width = 4
    popupAnnotation.Border.HorizontalRadius = 20
    popupAnnotation.Border.VerticalRadius = 30
    'Sets the pdf popup icon.
    popupAnnotation.Icon = PdfPopupIcon.NewParagraph
    Dim popup As PdfPopupAnnotation = New PdfPopupAnnotation
    popup.State = PdfAnnotationState.Accepted
    popup.StateModel = PdfAnnotationStateModel.Review
    popup.Text = "Hello PDF Comments"
    popupAnnotation.ReviewHistory.Add(popup)
    Dim reviewCollection As PdfPopupAnnotationCollection = popupAnnotation.ReviewHistory
    'Saves the document to disk.
    doc.Save("Output.pdf")
    doc.Close(true)

    State

    Gets or sets the annotation review State.

    Declaration
    public PdfAnnotationState State { get; set; }
    Property Value
    Type Description
    PdfAnnotationState
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page.
    PdfPage page = document.Pages.Add();
    //To specify the line end points
    int[] points = new int[] { 80, 420, 150, 420 };
    //Create a new line annotation and set properties.
    PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(points);
    lineAnnotation.Text = "Line Annotation";
    //Create pdf line border
    LineBorder lineBorder = new LineBorder();
    lineBorder.BorderStyle = PdfBorderStyle.Solid;
    lineBorder.BorderWidth = 1;
    lineAnnotation.lineBorder = lineBorder;
    lineAnnotation.LineIntent = PdfLineIntent.LineDimension;
    //Add Review state
    //set Review and comments
    PdfPopupAnnotation popup = new PdfPopupAnnotation();
    popup.State = PdfAnnotationState.Accepted;
    popup.StateModel = PdfAnnotationStateModel.Review;
    popup.Author = "Hello";
    popup.Text = "Hello PDF Comments";
    lineAnnotation.ReviewHistory.Add(popup);
    //Add this annotation to a new page.
    page.Annotations.Add(lineAnnotation);
    lineAnnotation.ReviewHistory.Add(testreview);
    //Save the document to disk.
    document.Save("OutputLinePopup.pdf");
    //close the document
    document.Close(true);
    Dim document As PdfDocument = New PdfDocument
    Dim page As PdfPage = document.Pages.Add
    Dim points() As Integer = New Integer() { 80, 420, 150, 420}
    Dim lineAnnotation As PdfLineAnnotation = New PdfLineAnnotation(points)
    lineAnnotation.Text = "Line Annotation"
    Dim lineBorder As LineBorder = New LineBorder
    lineBorder.BorderStyle = PdfBorderStyle.Solid
    lineBorder.BorderWidth = 1
    lineAnnotation.lineBorder = lineBorder
    lineAnnotation.LineIntent = PdfLineIntent.LineDimension
    Dim popup As PdfPopupAnnotation = New PdfPopupAnnotation
    popup.State = PdfAnnotationState.Accepted
    popup.StateModel = PdfAnnotationStateModel.Review
    popup.Author = "Hello"
    popup.Text = "Hello PDF Comments"
    lineAnnotation.ReviewHistory.Add(popup)
    'Add this annotation to a new page.
    page.Annotations.Add(lineAnnotation)
    lineAnnotation.ReviewHistory.Add(testreview)
    'Save the document to disk.
    document.Save("OutputLinePopup.pdf")
    'close the document
    document.Close(true)

    StateModel

    Gets or sets the annotation review State Model.

    Declaration
    public PdfAnnotationStateModel StateModel { get; set; }
    Property Value
    Type Description
    PdfAnnotationStateModel
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page.
    PdfPage page = document.Pages.Add();
    //To specify the line end points
    int[] points = new int[] { 80, 420, 150, 420 };
    //Create a new line annotation and set properties.
    PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(points);
    lineAnnotation.Text = "Line Annotation";
    //Create pdf line border
    LineBorder lineBorder = new LineBorder();
    lineBorder.BorderStyle = PdfBorderStyle.Solid;
    lineBorder.BorderWidth = 1;
    lineAnnotation.lineBorder = lineBorder;
    lineAnnotation.LineIntent = PdfLineIntent.LineDimension;
    //Add Review state
    //set Review and comments
    PdfPopupAnnotation popup = new PdfPopupAnnotation();
    popup.State = PdfAnnotationState.Accepted;
    popup.StateModel = PdfAnnotationStateModel.Review;
    popup.Author = "Hello";
    popup.Text = "Hello PDF Comments";
    lineAnnotation.ReviewHistory.Add(popup);
    //Add this annotation to a new page.
    page.Annotations.Add(lineAnnotation);
    lineAnnotation.ReviewHistory.Add(testreview);
    //Save the document to disk.
    document.Save("OutputLinePopup.pdf");
    //close the document
    document.Close(true);
    Dim document As PdfDocument = New PdfDocument
    Dim page As PdfPage = document.Pages.Add
    Dim points() As Integer = New Integer() { 80, 420, 150, 420}
    Dim lineAnnotation As PdfLineAnnotation = New PdfLineAnnotation(points)
    lineAnnotation.Text = "Line Annotation"
    Dim lineBorder As LineBorder = New LineBorder
    lineBorder.BorderStyle = PdfBorderStyle.Solid
    lineBorder.BorderWidth = 1
    lineAnnotation.lineBorder = lineBorder
    lineAnnotation.LineIntent = PdfLineIntent.LineDimension
    Dim popup As PdfPopupAnnotation = New PdfPopupAnnotation
    popup.State = PdfAnnotationState.Accepted
    popup.StateModel = PdfAnnotationStateModel.Review
    popup.Author = "Hello"
    popup.Text = "Hello PDF Comments"
    lineAnnotation.ReviewHistory.Add(popup)
    'Add this annotation to a new page.
    page.Annotations.Add(lineAnnotation)
    lineAnnotation.ReviewHistory.Add(testreview)
    'Save the document to disk.
    document.Save("OutputLinePopup.pdf")
    'close the document
    document.Close(true)

    Methods

    Initialize()

    Initializes annotation object.

    Declaration
    protected override void Initialize()
    Overrides
    PdfAnnotation.Initialize()

    Save()

    Saves an annotation.

    Declaration
    protected override void Save()
    Overrides
    PdfAnnotation.Save()

    Implements

    System.ComponentModel.INotifyPropertyChanged
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved