Skip to main content
All docs
V23.2

PdfPageFacade.AddPolyLineAnnotation(PdfPoint[]) Method

Creates a polyline annotation by the specified vertices.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v23.2.Core.dll

NuGet Package: DevExpress.Pdf.Core

Declaration

public PdfPolyLineAnnotationFacade AddPolyLineAnnotation(
    params PdfPoint[] points
)

Parameters

Name Type Description
points PdfPoint[]

An array of polyline vertices.

Returns

Type Description
PdfPolyLineAnnotationFacade

An object that contains polyline annotation properties.

Example

The code sample below creates a polyline annotation:

polyline

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");
}
See Also