Skip to main content
All docs
V25.1
  • PdfPageFacade.AddLineAnnotation(PdfPoint, PdfPoint) Method

    Creates a line annotation between the specified points.

    Namespace: DevExpress.Pdf

    Assembly: DevExpress.Pdf.v25.1.Core.dll

    NuGet Package: DevExpress.Pdf.Core

    Declaration

    public PdfLineAnnotationFacade AddLineAnnotation(
        PdfPoint start,
        PdfPoint end
    )

    Parameters

    Name Type Description
    start PdfPoint

    The start point of the annotation.

    end PdfPoint

    The end point of the annotation.

    Returns

    Type Description
    PdfLineAnnotationFacade

    An object that contains the line annotation properties.

    Example

    The code sample below creates a red line annotation:

    line annotation

    using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
    {
        // Load a document
        processor.LoadDocument("..\\..\\Document.pdf");
    
        // Access the first page properties
        PdfPageFacade pageFacade = processor.DocumentFacade.Pages[0];
    
        // Define an annotation's start and end points
        PdfPoint start = new PdfPoint(100, 100);
        PdfPoint end = new PdfPoint(150, 100);
    
        // Add a line annotation
        PdfLineAnnotationFacade lineAnnotation = pageFacade.AddLineAnnotation(start, end);
    
        // Specify the annotation parameters
        lineAnnotation.Author = "Brian Zetc";
        lineAnnotation.BorderStyle = PdfBorderStyle.DashDot;
        lineAnnotation.BorderWidth = 3;
        lineAnnotation.Color = new PdfRGBColor(0.8, 0.2, 0.1);
        lineAnnotation.Contents = "Made in PDF Document API";
    
        // Save the result
        processor.SaveDocument("..\\..\\Result.pdf");
    }
    
    See Also