Class PdfSquareMeasurementAnnotation
Represents the annotation with Square Measurement.
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
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 PdfSquareMeasurementAnnotation : PdfAnnotation, IPdfWrapper, INotifyPropertyChanged
Constructors
PdfSquareMeasurementAnnotation(RectangleF)
Declaration
public PdfSquareMeasurementAnnotation(RectangleF rectangle)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rectangle |
Properties
Border
Get or set the border style of the square annotaion.
Declaration
public LineBorder Border { get; set; }
Property Value
Type | Description |
---|---|
LineBorder |
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 Square annotation.
PdfSquareMeasurementAnnotation squareannotation = new PdfSquareMeasurementAnnotation(new RectangleF(0, 30, 80, 80));
squareannotation.Text = "SquareAnnotation";
squareannotation.InnerColor = new PdfColor(Color.Red);
LineBorder border = new LineBorder();
border.BorderStyle = PdfBorderStyle.Solid;
border.BorderWidth = 2;
squareannotation.Border = border;
squareannotation.Color = new PdfColor(Color.Yellow);
page.Graphics.DrawString("Square Measurement Annotation", font, brush, new PointF(0, 0));
//Add the annotation to the page.
page.Annotations.Add(squareannotation);
//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 Square annotation.
Dim squareannotation As PdfSquareMeasurementAnnotation = New PdfSquareMeasurementAnnotation(New RectangleF(0, 30, 80, 80))
squareannotation.Text = "SquareAnnotation"
squareannotation.InnerColor = New PdfColor(Color.Red)
Dim border As LineBorder = New LineBorder()
border.BorderStyle = PdfBorderStyle.Solid
border.BorderWidth = 2
squareannotation.Border = border
squareannotation.Color = New PdfColor(Color.Yellow)
page.Graphics.DrawString("Square Measurement Annotation", font, brush, New PointF(0, 0))
'Add annotation to the page.
page.Annotations.Add(squareannotation)
'Save the document.
document.Save("Output.pdf")
'Close the document.
document.Close(True)
See Also
Font
Gets or sets the font of the text annotation
Declaration
public PdfFont Font { get; set; }
Property Value
Type | Description |
---|---|
PdfFont |
Unit
Get or set PdfMeasurement Unit.
Declaration
public PdfMeasurementUnit Unit { get; set; }
Property Value
Type | Description |
---|---|
PdfMeasurementUnit |
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