Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.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