PdfLineMeasurementAnnotation Class
Represents the annotation with Line Measurement.
Implements
Inherited Members
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfLineMeasurementAnnotation : PdfAnnotation, IPdfWrapper, INotifyPropertyChanged
Constructors
PdfLineMeasurementAnnotation(Int32[])
Initializes new instance of PdfLineAnnotation class with specified points.
Declaration
public PdfLineMeasurementAnnotation(int[] linePoints)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | linePoints | 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
Declaration
public PdfLineCaptionType m_captionType
Field Value
Type |
---|
PdfLineCaptionType |
Properties
BackColor
Gets or sets the BackgroundColor of the PdfLineAnnotation.
Declaration
public PdfColor BackColor { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public PdfLineEndingStyle BeginLineStyle { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public PdfLineCaptionType CaptionType { get; set; }
Property Value
Type | Description |
---|---|
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
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
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.
Declaration
public PdfLineEndingStyle EndLineStyle { get; set; }
Property Value
Type | Description |
---|---|
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
Declaration
public PdfFont Font { get; set; }
Property Value
Type |
---|
PdfFont |
InnerLineColor
To specifying the Inner Line color color with which to fill the annotation’s line endings.
Declaration
public PdfColor InnerLineColor { get; set; }
Property Value
Type | Description |
---|---|
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
Declaration
public int LeaderLine { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | 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.
Declaration
public int LeaderLineExt { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | 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
Declaration
public int LeaderOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | 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
lineBorder
Gets or sets the border style of the LineAnnotation.
Declaration
public LineBorder lineBorder { get; set; }
Property Value
Type | Description |
---|---|
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
LineCaption
Gets or sets whether the line annotation caption should be displayed.
Declaration
public bool LineCaption { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
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.
Declaration
public PdfLineIntent LineIntent { get; set; }
Property Value
Type |
---|
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.
Declaration
public int[] LinePoints { get; set; }
Property Value
Type |
---|
System.Int32[] |
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
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
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.
Declaration
public PdfMeasurementUnit Unit { get; set; }
Property Value
Type |
---|
PdfMeasurementUnit |
Methods
Initialize()
Initializes annotation object.
Declaration
protected override void Initialize()
Overrides
Save()
Saves an annotation.
Declaration
protected override void Save()