Xamarin.Android

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

    Show / Hide Table of Contents

    Class PdfSquareMeasurementAnnotation

    Represents the annotation with Square Measurement.

    Inheritance
    System.Object
    PdfAnnotation
    PdfSquareMeasurementAnnotation
    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.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
    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public class PdfSquareMeasurementAnnotation : PdfAnnotation, IPdfWrapper, INotifyPropertyChanged

    Constructors

    PdfSquareMeasurementAnnotation(RectangleF)

    Declaration
    public PdfSquareMeasurementAnnotation(RectangleF rectangle)
    Parameters
    Type Name Description
    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
    PdfPage
    PdfAnnotationCollection

    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
    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