PdfPageFacade.AddPolygonAnnotation(PdfPoint[]) Method
Creates a polygon annotation by the specified vertices.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Pdf.v24.2.Core.dll
NuGet Package: DevExpress.Pdf.Core
#Declaration
public PdfPolygonAnnotationFacade AddPolygonAnnotation(
params PdfPoint[] points
)
#Parameters
Name | Type | Description |
---|---|---|
points | Pdf |
An array of points that is the polygon vertices. |
#Returns
Type | Description |
---|---|
Pdf |
An object that contains polygon annotation properties. |
#Example
The code sample below creates a hexagon:
using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
// Load a document
processor.LoadDocument("..\\..\\Document.pdf");
// Access the firs page properties
PdfPageFacade pageFacade = processor.DocumentFacade.Pages[0];
// Define hexagon vertices
PdfPoint point1 = new PdfPoint(150, 150);
PdfPoint point2 = new PdfPoint(140, 160);
PdfPoint point3 = new PdfPoint(150, 170);
PdfPoint point4 = new PdfPoint(160, 170);
PdfPoint point5 = new PdfPoint(170, 160);
PdfPoint point6 = new PdfPoint(160, 150);
PdfPoint[] points = new PdfPoint[] { point1, point2, point3, point4, point5, point6 };
// Create a hexagon annotation
PdfPolygonAnnotationFacade hexagon = pageFacade.AddPolygonAnnotation(points);
hexagon.Author = "Cardle Anita W";
// Save the result
processor.SaveDocument("..\\..\\Result.pdf");
}