Skip to main content
All docs
V25.1
  • 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.v25.1.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 following code snippet 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[] points = new PdfPoint[]
      {
          new PdfPoint(100, 100),
          new PdfPoint(120, 100),
          new PdfPoint(130, 110),
          new PdfPoint(130, 110),
          new PdfPoint(140, 100),
          new PdfPoint(150, 150)
      };
    
      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