Class PdfCircleMeasurementAnnotation
- Namespace
- Syncfusion.Pdf.Interactive
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents the annotation with Circle Measurement.
public class PdfCircleMeasurementAnnotation : PdfAnnotation, INotifyPropertyChanged
- Inheritance
-
PdfCircleMeasurementAnnotation
- Implements
- Inherited Members
Constructors
PdfCircleMeasurementAnnotation(RectangleF)
Initializes new instance of PdfCircleMeasurementAnnotation class with bounds.
public PdfCircleMeasurementAnnotation(RectangleF rectangle)
Parameters
rectangle
RectangleFUsed to represent the bounds of the annotation
Properties
Border
Get or set the border style of the circle annotaion.
public LineBorder Border { get; set; }
Property Value
Comments
Gets the annotation comments
public PdfPopupAnnotationCollection Comments { get; }
Property Value
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
RectangleF rectangle = new RectangleF(10, 100, 100, 100);
//Create a new line annotation and set properties.
PdfCircleMeasurementAnnotation circleMeasureAnnotation = new PdfCircleMeasurementAnnotation(rectangle);
//Assign author to the circle measurement annotation
circleMeasureAnnotation.Author = "Syncfusion";
//Assign subject to the circle measurement annotation
circleMeasureAnnotation.Subject = "Circle measurement annotation";
//Assign color to the square measurement annotation
circleMeasureAnnotation.Color = new PdfColor(Color.Red);
//Assign measurement unit to the circle measurement annotation
circleMeasureAnnotation.Unit = PdfMeasurementUnit.Centimeter;
//Sets the measurementType to the circle measurement annotation
circleMeasureAnnotation.MeasurementType = PdfCircleMeasurementType.Diameter;
//Add comment state
PdfPopupAnnotation popupComments = new PdfPopupAnnotation();
popupComments.Author = "TestAuthor";
popupComments.Text = "Test Text";
circleMeasureAnnotation.Comments.Add(popupComments);
//Get annotation comments
PdfPopupAnnotationCollection commentsCollection = circleMeasureAnnotation.Comments;
page.Annotations.Add(circleMeasureAnnotation);
//Saves the document to disk.
document.Save("Output.pdf");
document.Close(true);
'Creates a new PDF document
Dim document As New PdfDocument()
'Creates a new page
Dim page As PdfPage = document.Pages.Add()
Dim rect As New RectangleF(10, 100, 100, 100)
'Creates the circle measurement annotation
Dim circleMeasureAnnotation As New PdfCircleMeasurementAnnotation(rect)
'Assign author to the circle measurement annotation
circleMeasureAnnotation.Author = "Syncfusion"
'Assign subject to the circle measurement annotation
circleMeasureAnnotation.Subject = "Circle measurement annotation"
'Assign color to the square measurement annotation
circleMeasureAnnotation.Color = New PdfColor(Color.Red)
'Assign measurement unit to the circle measurement annotation
circleMeasureAnnotation.Unit = PdfMeasurementUnit.Centimeter
'Sets the measurementType to the circle measurement annotation
circleMeasureAnnotation.MeasurementType = PdfCircleMeasurementType.Diameter
Dim popupComments As PdfPopupAnnotation = New PdfPopupAnnotation
popupComments.Author = "TestAuthor"
popupComments.Text = "Test Text"
circleMeasureAnnotation.Comments.Add(popupComments)
Dim commentsCollection As PdfPopupAnnotationCollection = circleMeasureAnnotation.Comments
page.Annotations.Add(circleMeasureAnnotation)
'Saves the document to disk.
document.Save("Output.pdf")
document.Close(true)
Font
Gets or sets the font of the text annotation
public PdfFont Font { get; set; }
Property Value
MeasurementType
Get or set the PdfCircleMeasurementType
public PdfCircleMeasurementType MeasurementType { get; set; }
Property Value
ReviewHistory
Gets the annotation reviews
public PdfPopupAnnotationCollection ReviewHistory { get; }
Property Value
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
RectangleF rectangle = new RectangleF(10, 100, 100, 100);
//Create a new line annotation and set properties.
PdfCircleMeasurementAnnotation circleMeasureAnnotation = new PdfCircleMeasurementAnnotation(rectangle);
//Assign author to the circle measurement annotation
circleMeasureAnnotation.Author = "Syncfusion";
//Assign subject to the circle measurement annotation
circleMeasureAnnotation.Subject = "Circle measurement annotation";
//Assign color to the square measurement annotation
circleMeasureAnnotation.Color = new PdfColor(Color.Red);
//Assign measurement unit to the circle measurement annotation
circleMeasureAnnotation.Unit = PdfMeasurementUnit.Centimeter;
//Sets the measurementType to the circle measurement annotation
circleMeasureAnnotation.MeasurementType = PdfCircleMeasurementType.Diameter;
//Add Review state
PdfPopupAnnotation popup = new PdfPopupAnnotation();
popup.State = PdfAnnotationState.Accepted;
popup.StateModel = PdfAnnotationStateModel.Review;
popup.Text = "Hello PDF Comments";
popup.Author = "Test1";
circleMeasureAnnotation.ReviewHistory.Add(popup);
//Get Review history
PdfPopupAnnotationCollection reviewCollection = circleMeasureAnnotation.ReviewHistory;
page.Annotations.Add(circleMeasureAnnotation);
//Saves the document to disk.
document.Save("Output.pdf");
document.Close(true);
'Creates a new PDF document
Dim document As New PdfDocument()
'Creates a new page
Dim page As PdfPage = document.Pages.Add()
Dim rect As New RectangleF(10, 100, 100, 100)
'Creates the circle measurement annotation
Dim circleMeasureAnnotation As New PdfCircleMeasurementAnnotation(rect)
'Assign author to the circle measurement annotation
circleMeasureAnnotation.Author = "Syncfusion"
'Assign subject to the circle measurement annotation
circleMeasureAnnotation.Subject = "Circle measurement annotation"
'Assign color to the square measurement annotation
circleMeasureAnnotation.Color = New PdfColor(Color.Red)
'Assign measurement unit to the circle measurement annotation
circleMeasureAnnotation.Unit = PdfMeasurementUnit.Centimeter
'Sets the measurementType to the circle measurement annotation
circleMeasureAnnotation.MeasurementType = PdfCircleMeasurementType.Diameter
Dim popup As PdfPopupAnnotation = New PdfPopupAnnotation
popup.State = PdfAnnotationState.Accepted
popup.StateModel = PdfAnnotationStateModel.Review
popup.Text = "Hello PDF Comments"
popup.Author = "Test1"
circleMeasureAnnotation.ReviewHistory.Add(popup)
Dim reviewCollection As PdfPopupAnnotationCollection = circleMeasureAnnotation.ReviewHistory
page.Annotations.Add(circleMeasureAnnotation)
'Saves the document to disk.
document.Save("Output.pdf")
document.Close(true)
Unit
Get or set PdfMeasurement Unit.
public PdfMeasurementUnit Unit { get; set; }
Property Value
Methods
Initialize()
Initializes annotation object.
protected override void Initialize()
Save()
Saves an annotation.
protected override void Save()