Skip to main content
All docs
V24.1

PdfFreeTextAnnotationFacade.SetCallout(PdfAnnotationLineEndingStyle, PdfPoint, Nullable<PdfPoint>, PdfPoint) Method

Adds a callout line to the free text annotation.

Namespace: DevExpress.Pdf

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

NuGet Package: DevExpress.Pdf.Core

Declaration

public void SetCallout(
    PdfAnnotationLineEndingStyle calloutLineEndingStyle,
    PdfPoint startPoint,
    PdfPoint? kneePoint,
    PdfPoint endPoint
)

Parameters

Name Type Description
calloutLineEndingStyle PdfAnnotationLineEndingStyle

Indicates the ending style of the callout line.

startPoint PdfPoint

The start point of the callout line.

kneePoint Nullable<PdfPoint>

The knee point of the line curve.

endPoint PdfPoint

The end point of the callout line.

Remarks

The code sample below creates a callout annotation pointed at a specific phrase:

callout

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

    // Access the first page properties
    PdfPageFacade pageFacade = processor.DocumentFacade.Pages[0];
    PdfRectangle calloutRect;

    // Find the target phrase in the document
    string strikeOutText = "Evaluation";
    PdfTextSearchResults strikeSearchResults = processor.FindText(strikeOutText);

    if (strikeSearchResults.Status == PdfTextSearchStatus.Found)
    {
        // Specify an area to point a callout line
        calloutRect = strikeSearchResults.Rectangles[0].BoundingRectangle;

        // Define an annotation area
        PdfRectangle rectangle = new PdfRectangle(663, 526, 763, 576);

        // Create a free text annotation
        PdfFreeTextAnnotationFacade freeText =
            pageFacade.AddFreeTextAnnotation(rectangle, "Free Text Annotation");

        // Specify annotation parameters
        freeText.Author = "Nancy Davolio";

        // Specify the knee point for the callout line
        PdfPoint kneePoint = new PdfPoint(calloutRect.Center.X, rectangle.TopLeft.Y);

        // Add a callout line
        freeText.SetCallout(PdfAnnotationLineEndingStyle.OpenArrow, calloutRect.Center, kneePoint, rectangle.TopLeft);
    }

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