Class PdfCircleAnnotation
Represents a PDF circle annotation
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class PdfCircleAnnotation : PdfAnnotation, IPdfWrapper, INotifyPropertyChanged
Constructors
PdfCircleAnnotation(RectangleF)
Initialise the new instance of the circle annotation with bounds.
Declaration
public PdfCircleAnnotation(RectangleF rectangle)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rectangle | Used to represent the bounds of the annotation |
PdfCircleAnnotation(RectangleF, String)
Initialise the new instance of the circle annotation with bounds and text.
Declaration
public PdfCircleAnnotation(RectangleF rectangle, string text)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rectangle | Used to represent the bounds of the annotation |
System.String | text | Used to represents the text of the annotation |
Properties
Border
Get or set the border style of the circle annotaion.
Declaration
public LineBorder Border { get; set; }
Property Value
Type |
---|
LineBorder |
BorderEffect
Get or set the border effect of the Circle annotation.
Declaration
public PdfBorderEffect BorderEffect { get; set; }
Property Value
Type |
---|
PdfBorderEffect |
Examples
//Creates a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page
PdfPage page = document.Pages.Add();
document.PageSettings.SetMargins(0);
//Set the font
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 10f);
PdfBrush brush = new PdfSolidBrush(System.Drawing.Color.Black);
//Creates a new Circle annotation.
PdfCircleAnnotation circleAnnotation = new PdfCircleAnnotation(new RectangleF(0, 30, 80, 80));
circleAnnotation.Text = "CircleAnnotation";
circleAnnotation.InnerColor = new PdfColor(Color.Red);
PdfBorderEffect borderEffect = new PdfBorderEffect();
borderEffect.Intensity=2;
borderEffect.Style = PdfBorderEffectStyle.Cloudy;
circleAnnotation.BorderEffect = borderEffect;
circleAnnotation.Color = new PdfColor(Color.Yellow);
page.Graphics.DrawString("Circle Annotation", font, brush, new PointF(0, 0));
//Add the annotation to the page.
page.Annotations.Add(circleAnnotation);
//Save the document.
document.Save("Output.pdf");
//Close the document.
document.Close(true);
'Creates a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page
Dim page As PdfPage = document.Pages.Add()
document.PageSettings.SetMargins(0)
'Set the font.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 10.0F)
Dim brush As PdfBrush = New PdfSolidBrush(System.Drawing.Color.Black)
'Creates a new Circle Annotation.
Dim circleAnnotation As PdfCircleAnnotation = New PdfCircleAnnotation(New RectangleF(0, 30, 80, 80))
circleAnnotation.Text = "CircleAnnotation"
circleAnnotation.InnerColor = New PdfColor(Color.Red)
Dim borderEffect As PdfBorderEffect()
borderEffect.Intensity=2;
borderEffect.Style = PdfBorderEffectStyle.Cloudy
circleAnnotation.BorderEffect = borderEffect
circleAnnotation.Color = New PdfColor(Color.Yellow)
page.Graphics.DrawString("Circle Annotation", font, brush, New PointF(0, 0))
'Add annotation to the page.
page.Annotations.Add(circleAnnotation)
'Save the document.
document.Save("Output.pdf")
'Close the document.
document.Close(True)
Comments
Gets the annotation comments
Declaration
public PdfPopupAnnotationCollection Comments { get; }
Property Value
Type |
---|
PdfPopupAnnotationCollection |
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
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//Create a new line annotation and set properties.
PdfCircleAnnotation circleAnnotation = new PdfCircleAnnotation(rectangle);
circleAnnotation.Text = "Circle";
//Add comment state
PdfPopupAnnotation popupComments = new PdfPopupAnnotation();
popupComments.Author = "TestAuthor";
popupComments.Text = "Test Text";
circleAnnotation.Comments.Add(popupComments);
//Get annotation comments
PdfPopupAnnotationCollection commentsCollection = circleAnnotation.Comments;
//Saves the document to disk.
document.Save("Output.pdf");
document.Close(true);
Dim document As PdfDocument = New PdfDocument
Dim page As PdfPage = document.Pages.Add
Dim rectangle As RectangleF = New RectangleF(10, 40, 30, 30)
Dim circleAnnotation As PdfCircleAnnotation = New PdfCircleAnnotation(rectangle)
circleAnnotation.Text = "Circle"
Dim popupComments As PdfPopupAnnotation = New PdfPopupAnnotation
popupComments.Author = "TestAuthor"
popupComments.Text = "Test Text"
circleAnnotation.Comments.Add(popupComments)
Dim commentsCollection As PdfPopupAnnotationCollection = circleAnnotation.Comments
'Saves the document to disk.
document.Save("Output.pdf")
document.Close(true)
ReviewHistory
Gets the annotation reviews
Declaration
public PdfPopupAnnotationCollection ReviewHistory { get; }
Property Value
Type |
---|
PdfPopupAnnotationCollection |
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
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//Create a new line annotation and set properties.
PdfCircleAnnotation circleAnnotation = new PdfCircleAnnotation(rectangle);
circleAnnotation.Text = "Circle";
//Add Review state
PdfPopupAnnotation popup = new PdfPopupAnnotation();
popup.State = PdfAnnotationState.Accepted;
popup.StateModel = PdfAnnotationStateModel.Review;
popup.Text = "Hello PDF Comments";
popup.Author = "Test1";
circleAnnotation.ReviewHistory.Add(popup);
//Get Review history
PdfPopupAnnotationCollection reviewCollection = circleAnnotation.ReviewHistory;
//Saves the document to disk.
document.Save("Output.pdf");
document.Close(true);
Dim document As PdfDocument = New PdfDocument
Dim page As PdfPage = document.Pages.Add
Dim rectangle As RectangleF = New RectangleF(10, 40, 30, 30)
Dim circleAnnotation As PdfCircleAnnotation = New PdfCircleAnnotation(rectangle)
circleAnnotation.Text = "Circle"
Dim popup As PdfPopupAnnotation = New PdfPopupAnnotation
popup.State = PdfAnnotationState.Accepted
popup.StateModel = PdfAnnotationStateModel.Review
popup.Text = "Hello PDF Comments"
popup.Author = "Test1"
circleAnnotation.ReviewHistory.Add(popup)
Dim reviewCollection As PdfPopupAnnotationCollection = circleAnnotation.ReviewHistory
'Saves the document to disk.
document.Save("Output.pdf")
document.Close(true)
Methods
Initialize()
Initializes annotation object.
Declaration
protected override void Initialize()
Overrides
Save()
Saves an annotation.
Declaration
protected override void Save()
Overrides
Implements
System.ComponentModel.INotifyPropertyChanged