Skip to main content
All docs
V23.2

PdfPageFacade.AddInkAnnotation(IList<IList<PdfPoint>>) Method

Creates an ink annotation comprised of one or multiple points on the page.

Namespace: DevExpress.Pdf

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

NuGet Package: DevExpress.Pdf.Core

Declaration

public PdfInkAnnotationFacade AddInkAnnotation(
    IList<IList<PdfPoint>> inks
)

Parameters

Name Type Description
inks IList<IList<PdfPoint>>

A list of points used create an annotation.

Returns

Type Description
PdfInkAnnotationFacade

An object that contains ink annotation properties.

Example

The code sample below creates an ink annotation:

ink annotation

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
  // Load a document
  processor.LoadDocument("..\\..\\Document.pdf");

  // Access page properties
  PdfPageFacade pageFacade = processor.DocumentFacade.Pages[0];

  // Define ink 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 point6 = new PdfPoint(150, 150);
  PdfPoint[] points = new PdfPoint[]
  {
      point1,
      point2,
      point3,
      point4,
      point5,
      point6
  };

  List<IList<PdfPoint>> inks = new List<IList<PdfPoint>> { points };

  // Create an ink annotation
  PdfInkAnnotationFacade inkAnnotation = pageFacade.AddInkAnnotation(inks);
  inkAnnotation.Author = "Brian Zetc";
  inkAnnotation.BorderWidth = 1.0;

  // Save the result
  processor.SaveDocument("..\\..\\Result.pdf");
}
See Also