Class PdfLineAnnotation
Represents a line annotation.
Implements
Inherited Members
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfLineAnnotation : PdfAnnotation, IPdfWrapper, INotifyPropertyChanged
Remarks
This PdfLineAnnotation class is used to represents line annotation in PDF document. Please refer the UG docuemntation link https://help.syncfusion.com/file-formats/pdf/working-with-annotations#line-annotation for more details.
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 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.
Dim lineAnnotation As New PdfLineAnnotation(points, "Line Annoation")
'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)
Constructors
PdfLineAnnotation(RectangleF)
Initializes new instance of PdfLineAnnotation class with specified bounds.
Declaration
public PdfLineAnnotation(RectangleF rectangle)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rectangle | The bounds 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 and set properties.
PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(new RectangleF(80, 420, 150, 420));
lineAnnotation.Text = "Line Annotation";
lineAnnotation.LinePoints = points;
//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(New RectangleF(80, 420, 150, 420))
lineAnnotation.Text = "Line Annotation"
lineAnnotation.LinePoints = points
'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
PdfLineAnnotation(Int32[])
Initializes new instance of PdfLineAnnotation class with specified points.
Declaration
public PdfLineAnnotation(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
PdfLineAnnotation(Int32[], String)
Initializes new instance of PdfLineAnnotation class with set of points and annotation text.
Declaration
public PdfLineAnnotation(int[] linePoints, string text)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | linePoints | The line points to be drawn. |
System.String | text | The line caption text of the annotation. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new pag .
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");
//Create pdf 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 pag .
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")
'Create pdf line border
Dim lineBorder As 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
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(points, "Line Annoation");
//Sets the begin line style.
lineAnnotation.BeginLineStyle = PdfLineEndingStyle.Butt;
//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 begin line style.
lineAnnotation.BeginLineStyle = PdfLineEndingStyle.Butt
'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 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;
//set comments
PdfPopupAnnotation popupComments = new PdfPopupAnnotation();
popupComments.Author = "TestAuthor";
popupComments.Text = "Test Text";
lineAnnotation.Comments.Add(popupComments);
//Get annotation comments
PdfPopupAnnotationCollection commentsCollection = lineAnnotation.Comments;
//Saves the document to disk.
document.Save("Output.pdf");
document.Close(true);
Dim document As PdfDocument = New PdfDocument
Dim page As PdfPage = document.Pages.Add
Dim points() As Integer = New Integer() { 80, 420, 150, 420}
Dim lineAnnotation As PdfLineAnnotation = New PdfLineAnnotation(points)
lineAnnotation.Text = "Line Annotation"
Dim lineBorder As LineBorder = New LineBorder
lineBorder.BorderStyle = PdfBorderStyle.Solid
lineBorder.BorderWidth = 1
lineAnnotation.lineBorder = lineBorder
lineAnnotation.LineIntent = PdfLineIntent.LineDimension
Dim popupComments As PdfPopupAnnotation = New PdfPopupAnnotation
popupComments.Author = "TestAuthor"
popupComments.Text = "Test Text"
lineAnnotation.Comments.Add(popupComments)
Dim commentsCollection As PdfPopupAnnotationCollection = lineAnnotation.Comments
'Saves the document to disk.
document.Save("Output.pdf")
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(points, "Line Annoation");
//Sets the line ending style.
lineAnnotation.EndLineStyle = PdfLineEndingStyle.Diamond;
//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 ending style.
lineAnnotation.EndLineStyle = PdfLineEndingStyle.Diamond
'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
InnerLineColor
Gets or sets an InnerColor of the PdfLineAnnotation.
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
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 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;
//Add Review state
PdfPopupAnnotation popup = new PdfPopupAnnotation();
popup.State = PdfAnnotationState.Accepted;
popup.StateModel = PdfAnnotationStateModel.Review;
popup.Text = "Hello PDF Comments";
lineAnnotation.ReviewHistory.Add(popup);
//Get Review history
PdfPopupAnnotationCollection reviewCollection = lineAnnotation.ReviewHistory;
//Saves the document to disk.
document.Save("Output.pdf");
document.Close(true);
Dim document As PdfDocument = New PdfDocument
Dim page As PdfPage = document.Pages.Add
Dim points() As Integer = New Integer() { 80, 420, 150, 420}
Dim lineAnnotation As PdfLineAnnotation = New PdfLineAnnotation(points)
lineAnnotation.Text = "Line Annotation"
Dim lineBorder As LineBorder = New LineBorder
lineBorder.BorderStyle = PdfBorderStyle.Solid
lineBorder.BorderWidth = 1
lineAnnotation.lineBorder = lineBorder
lineAnnotation.LineIntent = PdfLineIntent.LineDimension
Dim popup As PdfPopupAnnotation = New PdfPopupAnnotation
popup.State = PdfAnnotationState.Accepted
popup.StateModel = PdfAnnotationStateModel.Review
popup.Text = "Hello PDF Comments"
lineAnnotation.ReviewHistory.Add(popup)
Dim reviewCollection As PdfPopupAnnotationCollection = lineAnnotation.ReviewHistory
'Saves the document to disk.
document.Save("Output.pdf")
document.Close(true)
Methods
Initialize()
Initializes annotation object.
Declaration
protected override void Initialize()
Overrides
Save()
Saves an annotation.
Declaration
protected override void Save()