officefileapi-devexpress-dot-pdf-dot-pdfpagefacade-dot-addlineannotation-x28-devexpress-dot-pdf-dot-pdfpoint-devexpress-dot-pdf-dot-pdfpoint-x29.md
Creates a line annotation between the specified points.
Namespace : DevExpress.Pdf
Assembly : DevExpress.Pdf.v25.2.Core.dll
NuGet Package : DevExpress.Pdf.Core
public PdfLineAnnotationFacade AddLineAnnotation(
PdfPoint start,
PdfPoint end
)
Public Function AddLineAnnotation(
start As PdfPoint,
end As PdfPoint
) As PdfLineAnnotationFacade
| Name | Type | Description |
|---|---|---|
| start | PdfPoint |
The start point of the annotation.
| | end | PdfPoint |
The end point of the annotation.
|
| Type | Description |
|---|---|
| PdfLineAnnotationFacade |
An object that contains the line annotation properties.
|
The code sample below creates a red line annotation:
using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
// Load a document
processor.LoadDocument("..\\..\\Document.pdf");
// Access the first page properties
PdfPageFacade pageFacade = processor.DocumentFacade.Pages[0];
// Define an annotation's start and end points
PdfPoint start = new PdfPoint(100, 100);
PdfPoint end = new PdfPoint(150, 100);
// Add a line annotation
PdfLineAnnotationFacade lineAnnotation = pageFacade.AddLineAnnotation(start, end);
// Specify the annotation parameters
lineAnnotation.Author = "Brian Zetc";
lineAnnotation.BorderStyle = PdfBorderStyle.DashDot;
lineAnnotation.BorderWidth = 3;
lineAnnotation.Color = new PdfRGBColor(0.8, 0.2, 0.1);
lineAnnotation.Contents = "Made in PDF Document API";
// Save the result
processor.SaveDocument("..\\..\\Result.pdf");
}
Using processor As New PdfDocumentProcessor()
' Load a document
processor.LoadDocument("..\..\Document.pdf")
' Access the first page properties
Dim pageFacade As PdfPageFacade = processor.DocumentFacade.Pages(0)
' Define an annotation's start and end points
Dim start As New PdfPoint(100, 100)
Dim [end] As New PdfPoint(150, 100)
' Add a line annotation
Dim lineAnnotation As PdfLineAnnotationFacade = pageFacade.AddLineAnnotation(start, [end])
' Specify the annotation parameters
lineAnnotation.Author = "Brian Zetc"
lineAnnotation.BorderStyle = PdfBorderStyle.DashDot
lineAnnotation.BorderWidth = 3
lineAnnotation.Color = New PdfRGBColor(0.8, 0.2, 0.1)
lineAnnotation.Contents = "Made in PDF Document API"
' Save the result
processor.SaveDocument("..\..\Result.pdf")
End Using
See Also