[]
        
(Showing Draft Content)

Circle Annotation

A circle annotation displays an ellipse or circle on a page. When open, the annotation displays a pop-up window with the text of the associated note. DsPdf provides CircleAnnotation class to enable users to apply circle annotations to the PDF file.

Note that a circle annotation does not always imply that the annotation is circular in shape. The height and width of the annotation may vary. The image given below depicts an ellipse-shaped circle annotation.

DsPdf demonstrating how to add circle annotation in a PDF document

Refer to the following example code to add a circle annotation to a PDF document:

public void CreateCircleAnnotation()
{
    GcPdfDocument doc = new GcPdfDocument();
    Page page = doc.NewPage();
    RectangleF rc = new RectangleF(50, 50, 120, 50);
    page.Graphics.DrawString("A circle annotation drawn with a 3pt wide green line",
        new TextFormat() { Font = StandardFonts.Times, FontSize = 11 }, rc); rc.Inflate(15, 24);

    //Create an instance of CircleAnnotation class and set its relevant properties
    var circleAnnot = new CircleAnnotation()
    {
        UserName = "Jaime Smith",
        PdfRect = rc,
        LineWidth = 3,
        Color = Color.Green,
        Contents = "This is a circle annotation",
    };

    page.Annotations.Add(circleAnnot); //Add the circle annotation
    doc.Save("CircleAnnotation.pdf");
}