Table of Contents

Class PdfLineMeasurementAnnotation

Namespace
Syncfusion.Pdf.Interactive
Assembly
Syncfusion.Pdf.Portable.dll

Represents the annotation with Line Measurement.

public class PdfLineMeasurementAnnotation : PdfAnnotation, INotifyPropertyChanged
Inheritance
PdfLineMeasurementAnnotation
Implements
Inherited Members

Constructors

PdfLineMeasurementAnnotation(int[])

Initializes new instance of PdfLineAnnotation class with specified points.

public PdfLineMeasurementAnnotation(int[] linePoints)

Parameters

linePoints int[]

The line points is to be drawn.

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation and set properties.
PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(points);
lineAnnotation.Text = "Line Annotation";
//Create pdf line border
LineBorder lineBorder = new LineBorder();
lineBorder.BorderStyle = PdfBorderStyle.Solid;
lineBorder.BorderWidth = 1;
lineAnnotation.lineBorder = lineBorder;
lineAnnotation.LineIntent = PdfLineIntent.LineDimension;
//Assign the line ending style
lineAnnotation.BeginLineStyle = PdfLineEndingStyle.Butt;
lineAnnotation.EndLineStyle = PdfLineEndingStyle.Diamond;
lineAnnotation.AnnotationFlags = PdfAnnotationFlags.Default;
//Assign the line color
lineAnnotation.InnerLineColor = new PdfColor(Color.Green);
lineAnnotation.BackColor = new PdfColor(Color.Green);
//Assign the leader line
lineAnnotation.LeaderLineExt = 0;
lineAnnotation.LeaderLine = 0;
//Assign the Line caption type
lineAnnotation.LineCaption = true;
lineAnnotation.CaptionType = PdfLineCaptionType.Inline;
//Add this annotation to a new page.
page.Annotations.Add(lineAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page.
Dim page As PdfPage = document.Pages.Add()
'To specify the line end points
Dim points() As Integer = { 80, 420, 150, 420 }
'Create a new line annotation and set properties.
Dim lineAnnotation As New PdfLineAnnotation(points)
lineAnnotation.Text = "Line Annotation"
'Create pdf line border
Dim lineBorder As New LineBorder()
lineBorder.BorderStyle = PdfBorderStyle.Solid
lineBorder.BorderWidth = 1
lineAnnotation.lineBorder = lineBorder
lineAnnotation.LineIntent = PdfLineIntent.LineDimension
'Assign the line ending style
lineAnnotation.BeginLineStyle = PdfLineEndingStyle.Butt
lineAnnotation.EndLineStyle = PdfLineEndingStyle.Diamond
lineAnnotation.AnnotationFlags = PdfAnnotationFlags.Default
'Assign the line color
lineAnnotation.InnerLineColor = New PdfColor(Color.Green)
lineAnnotation.BackColor = New PdfColor(Color.Green)
'Assign the leader line
lineAnnotation.LeaderLineExt = 0
lineAnnotation.LeaderLine = 0
'Assign the Line caption type
lineAnnotation.LineCaption = True
lineAnnotation.CaptionType = PdfLineCaptionType.Inline
'Add this annotation to a new page.
page.Annotations.Add(lineAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

Fields

m_captionType

To specifying Caption Type

public PdfLineCaptionType m_captionType

Field Value

PdfLineCaptionType

Properties

BackColor

Gets or sets the BackgroundColor of the PdfLineAnnotation.

public PdfColor BackColor { get; set; }

Property Value

PdfColor

The PdfColor which draws the border of the line annotation.

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation.
PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(points, "Line Annoation");
//Sets the line back color.
lineAnnotation.BackColor = new PdfColor(Color.Green);
//Add this annotation to a new page.
page.Annotations.Add(lineAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'To specify the line end points
Dim points() As Integer = { 80, 420, 150, 420 }
'Create a new line annotation.
Dim lineAnnotation As New PdfLineAnnotation(points, "Line Annoation")
'Sets the line back color.
lineAnnotation.BackColor = New PdfColor(Color.Green)
'Add this annotation to a new page.
page.Annotations.Add(lineAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

BeginLineStyle

Gets or sets the style used for the beginning of the line.

public PdfLineEndingStyle BeginLineStyle { get; set; }

Property Value

PdfLineEndingStyle

A PdfLineEndingStyle enumeration member specifying the begin style for the line.

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation.
PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(new RectangleF(100, 100, 100, 20));
//Sets the LinePoints.
lineAnnotation.LinePoints = points;
lineAnnotation.LeaderOffset = 20;
lineAnnotation.BeginLineStyle = PdfLineEndingStyle.Circle;
//Add this annotation to a new page.
page.Annotations.Add(lineAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
See Also

CaptionType

Gets or sets the line caption text type of annotation.

public PdfLineCaptionType CaptionType { get; set; }

Property Value

PdfLineCaptionType

A PdfLineCaptionType enumeration specifying the line caption type.

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation.
PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(points, "Line Annoation");
//Sets the line caption type.
lineAnnotation.CaptionType = PdfLineCaptionType.Inline;
//Add this annotation to a new page.
page.Annotations.Add(lineAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'To specify the line end points
Dim points() As Integer = { 80, 420, 150, 420 }
'Create a new line annotation.
Dim lineAnnotation As New PdfLineAnnotation(points, "Line Annoation")
'Sets the line caption type.
lineAnnotation.CaptionType = PdfLineCaptionType.Inline
'Add this annotation to a new page.
page.Annotations.Add(lineAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

Comments

Gets the annotation comments

public PdfPopupAnnotationCollection Comments { get; }

Property Value

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation.
PdfLineMeaurementAnnotation lineMeasurementAnnotation = new PdfLineMeasurementAnnotation(points);
//Add comment state
PdfPopupAnnotation popupComments = new PdfPopupAnnotation();
popupComments.Author = "TestAuthor";
popupComments.Text = "Test Text";
lineMeasurementAnnotation.Comments.Add(popupComments);
//Get annotation comments
PdfPopupAnnotationCollection commentsCollection = lineMeasurementAnnotation.Comments;
//Add this annotation to a new page.
page.Annotations.Add(lineMeasurementAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'To specify the line end points
Dim points() As Integer = { 80, 420, 150, 420 }
'Create a new line annotation.
Dim lineMeasurementAnnotation As New PdfLineMeasuremntAnnotation(points)
Dim popupComments As PdfPopupAnnotation = New PdfPopupAnnotation
popupComments.Author = "TestAuthor"
popupComments.Text = "Test Text"
lineMeasurementAnnotation.Comments.Add(popupComments)
Dim commentsCollection As PdfPopupAnnotationCollection = lineMeasurementAnnotation.Comments
'Add this annotation to a new page.
page.Annotations.Add(lineMeasurementAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)

EndLineStyle

Gets or sets the style used for the end of the line.

public PdfLineEndingStyle EndLineStyle { get; set; }

Property Value

PdfLineEndingStyle

A PdfLineEndingStyle enumeration member specifying the end style for the line.

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation.
PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(new RectangleF(100, 100, 100, 20));
//Sets the LinePoints.
lineAnnotation.LinePoints = points;
lineAnnotation.LeaderOffset = 20;
lineAnnotation.EndLineStyle = PdfLineEndingStyle.Circle;
//Add this annotation to a new page.
page.Annotations.Add(lineAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
See Also

Font

Gets or sets the font of the text annotation

public PdfFont Font { get; set; }

Property Value

PdfFont

InnerLineColor

To specifying the Inner Line color color with which to fill the annotation’s line endings.

public PdfColor InnerLineColor { get; set; }

Property Value

PdfColor

The PdfColor which draws the outline of the inner color of the line annotation.

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation.
PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(points, "Line Annoation");
//Sets the inner line color.
lineAnnotation.InnerLineColor = new PdfColor(Color.Green);
//Add this annotation to a new page.
page.Annotations.Add(lineAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'To specify the line end points
Dim points() As Integer = { 80, 420, 150, 420 }
'Create a new line annotation.
Dim lineAnnotation As New PdfLineAnnotation(points, "Line Annoation")
'Sets the inner line color.
lineAnnotation.InnerLineColor = New PdfColor(Color.Green)
'Add this annotation to a new page.
page.Annotations.Add(lineAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

LeaderLine

Gets or sets the leader line

public int LeaderLine { get; set; }

Property Value

int

The value specifies the leader line of the annotation.

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation.
PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(points, "Line Annoation");
//Set the leader line.
lineAnnotation.LeaderLine = 10;
//Add this annotation to a new page.
page.Annotations.Add(lineAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page.
Dim page As PdfPage = document.Pages.Add()
'To specify the line end points
Dim points() As Integer = { 80, 420, 150, 420 }
'Create a new line annotation.
Dim lineAnnotation As New PdfLineAnnotation(points, "Line Annoation")
'Set the leader line.
lineAnnotation.LeaderLine = 10
'Add this annotation to a new page.
page.Annotations.Add(lineAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

LeaderLineExt

Gets or sets the LeaderLineExtension.

public int LeaderLineExt { get; set; }

Property Value

int

The value specifies the leader line extension of the annotation.

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation.
PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(points, "Line Annoation");
//Set the leader line extension.
lineAnnotation.LeaderLineExt = 10;
//Add this annotation to a new page.
page.Annotations.Add(lineAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'To specify the line end points
Dim points() As Integer = { 80, 420, 150, 420 }
'Create a new line annotation.
Dim lineAnnotation As New PdfLineAnnotation(points, "Line Annoation")
'Set the leader line extension.
lineAnnotation.LeaderLineExt = 10
'Add this annotation to a new page.
page.Annotations.Add(lineAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

LeaderOffset

Gets or sets the leader offset

public int LeaderOffset { get; set; }

Property Value

int

The value specifies the leader offset of the annotation.

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation.
PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(new RectangleF(100, 100, 100, 20));
//Sets the LinePoints.
lineAnnotation.LinePoints = points;
lineAnnotation.LeaderOffset = 20;
//Add this annotation to a new page.
page.Annotations.Add(lineAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
See Also

LineCaption

Gets or sets whether the line annotation caption should be displayed.

public bool LineCaption { get; set; }

Property Value

bool

true if the line caption should be displayed, otherwise false.

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation.
PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(points, "Line Annoation");
//Set the line caption.
lineAnnotation.LineCaption = true;
//Add this annotation to a new page.
page.Annotations.Add(lineAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'To specify the line end points
Dim points() As Integer = { 80, 420, 150, 420 }
'Create a new line annotation.
Dim lineAnnotation As New PdfLineAnnotation(points, "Line Annoation")
'Set the line caption.
lineAnnotation.LineCaption = True
'Add this annotation to a new page.
page.Annotations.Add(lineAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

LineIntent

Gets or sets the LineIntent of the annotation.

public PdfLineIntent LineIntent { get; set; }

Property Value

PdfLineIntent

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation.
PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(points, "Line Annoation");
//Sets the line intent.
lineAnnotation.LineIntent = PdfLineIntent.LineDimension;
//Add this annotation to a new page.
page.Annotations.Add(lineAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'To specify the line end points
Dim points() As Integer = { 80, 420, 150, 420 }
'Create a new line annotation.
Dim lineAnnotation As New PdfLineAnnotation(points, "Line Annoation")
'Sets the line intent.
lineAnnotation.LineIntent = PdfLineIntent.LineDimension
'Add this annotation to a new page.
page.Annotations.Add(lineAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

LinePoints

Gets or sets the LinePoints of the PdfLineAnnotation.

public int[] LinePoints { get; set; }

Property Value

int[]

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation.
PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(new RectangleF(100, 100, 100, 20));
//Sets the LinePoints.
lineAnnotation.LinePoints = points;
//Add this annotation to a new page.
page.Annotations.Add(lineAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'To specify the line end points
Dim points() As Integer = { 80, 420, 150, 420 }
'Create a new line annotation.
Dim lineAnnotation As New PdfLineAnnotation(New RectangleF(100, 100, 100, 20))
'Sets the LinePoints.
lineAnnotation.LinePoints = points
'Add this annotation to a new page.
page.Annotations.Add(lineAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

ReviewHistory

Gets the annotation reviews

public PdfPopupAnnotationCollection ReviewHistory { get; }

Property Value

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
int[] points = new int[] { 80, 420, 150, 420 };
//Create a new line annotation.
PdfLineMeasurementAnnotation lineMeasurementAnnotation = new PdfLineMeasurementAnnotation(points);
//Add Review state
PdfPopupAnnotation popup = new PdfPopupAnnotation();
popup.State = PdfAnnotationState.Accepted;
popup.StateModel = PdfAnnotationStateModel.Review;
popup.Text = "Hello PDF Comments";
popup.Author = "Test1";
lineMeasurementAnnotation.ReviewHistory.Add(popup);
//Get Review history
PdfPopupAnnotationCollection reviewCollection = lineMeasurementAnnotation.ReviewHistory;
//Add this annotation to a new page.
page.Annotations.Add(lineMeasurementAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'To specify the line end points
Dim points() As Integer = { 80, 420, 150, 420 }
'Create a new line annotation.
Dim lineMeasurementAnnotation As New PdfLineMeasurementAnnotation(points)
Dim popup As PdfPopupAnnotation = New PdfPopupAnnotation
popup.State = PdfAnnotationState.Accepted
popup.StateModel = PdfAnnotationStateModel.Review
popup.Text = "Hello PDF Comments"
popup.Author = "Test1"
lineMeasurementAnnotation.ReviewHistory.Add(popup)
Dim reviewCollection As PdfPopupAnnotationCollection = lineMeasurementAnnotation.ReviewHistory
'Add this annotation to a new page.
page.Annotations.Add(lineMeasurementAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)

Unit

Get or set PdfMeasurement Unit.

public PdfMeasurementUnit Unit { get; set; }

Property Value

PdfMeasurementUnit

lineBorder

Gets or sets the border style of the LineAnnotation.

public LineBorder lineBorder { get; set; }

Property Value

LineBorder

A LineBorder enumeration member specifying the border style for the line.

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
 int[] points = new int[] { 80, 420, 150, 420 };
 //Create a new line annotation.
 PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(points, "Line Annoation");
  //Set the line border.
 LineBorder lineBorder = new LineBorder();
 lineBorder.DashArray = 1;
lineAnnotation.lineBorder = lineBorder;
 //Add this annotation to a new page.
 page.Annotations.Add(lineAnnotation);
 //Save the document to disk.
 document.Save("Output.pdf");
 //close the document
 document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'To specify the line end points
Dim points() As Integer = { 80, 420, 150, 420 }
'Create a new line annotation.
Dim lineAnnotation As New PdfLineAnnotation(points, "Line Annoation")
'Set the line border.
 Dim lineBorder As LineBorder = New LineBorder()
 lineBorder.DashArray = 1
 lineAnnotation.lineBorder = lineBorder
'Add this annotation to a new page.
page.Annotations.Add(lineAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also

Methods

Initialize()

Initializes annotation object.

protected override void Initialize()

Save()

Saves an annotation.

protected override void Save()