officefileapi-devexpress-dot-pdf-dot-pdfpagefacade-dot-addpolylineannotation-x28-devexpress-dot-pdf-dot-pdfpoint-x29.md
Creates a polyline annotation by the specified vertices.
Namespace : DevExpress.Pdf
Assembly : DevExpress.Pdf.v25.2.Core.dll
NuGet Package : DevExpress.Pdf.Core
public PdfPolyLineAnnotationFacade AddPolyLineAnnotation(
params PdfPoint[] points
)
Public Function AddPolyLineAnnotation(
ParamArray points As PdfPoint()
) As PdfPolyLineAnnotationFacade
| Name | Type | Description |
|---|---|---|
| points | PdfPoint[] |
An array of polyline vertices.
|
| Type | Description |
|---|---|
| PdfPolyLineAnnotationFacade |
An object that contains polyline annotation properties.
|
The code sample below creates a polyline 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 polyline vertices
PdfPoint point1 = new PdfPoint(100, 100);
PdfPoint point2 = new PdfPoint(110, 110);
PdfPoint point3 = new PdfPoint(120, 100);
PdfPoint point4 = new PdfPoint(130, 110);
PdfPoint point5 = new PdfPoint(140, 100);
PdfPoint[] points = new PdfPoint[] { point1, point2, point3, point4, point5 };
// Create an annotation
PdfPolyLineAnnotationFacade polylineAnnotation = pageFacade.AddPolyLineAnnotation(points);
// Specify annotation parameters
polylineAnnotation.Author = "Rayn Anita W";
polylineAnnotation.Contents = "Made in PDF Document API";
polylineAnnotation.BorderWidth = 6;
polylineAnnotation.Color = new PdfRGBColor(0.8, 0.2, 0.1);
// 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 polyline vertices
Dim point1 As New PdfPoint(100, 100)
Dim point2 As New PdfPoint(110, 110)
Dim point3 As New PdfPoint(120, 100)
Dim point4 As New PdfPoint(130, 110)
Dim point5 As New PdfPoint(140, 100)
Dim points() As PdfPoint = { point1, point2, point3, point4, point5 }
' Create an annotation
Dim polylineAnnotation As PdfPolyLineAnnotationFacade = pageFacade.AddPolyLineAnnotation(points)
' Specify annotation parameters
polylineAnnotation.Author = "Rayn Anita W"
polylineAnnotation.Contents = "Made in PDF Document API"
polylineAnnotation.BorderWidth = 6
polylineAnnotation.Color = New PdfRGBColor(0.8, 0.2, 0.1)
' Save the result
processor.SaveDocument("..\..\Result.pdf")
End Using
See Also