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

PdfFreeTextAnnotationFacade.SetCallout(PdfAnnotationLineEndingStyle, PdfPoint) Method

Adds a callout line to the free text annotation.

Namespace: DevExpress.Pdf

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

NuGet Package: DevExpress.Pdf.Core

#Declaration

public void SetCallout(
    PdfAnnotationLineEndingStyle calloutLineEndingStyle,
    PdfPoint startPoint
)

#Parameters

Name Type Description
calloutLineEndingStyle PdfAnnotationLineEndingStyle

Indicates the ending style of the callout line.

startPoint PdfPoint

The start point of the callout line.

#Example

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 calloutRectangle;

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

    if (searchResults.Status == PdfTextSearchStatus.Found)
    {
        // Obtain the target phrase rectangle
        calloutRectangle = searchResults.Rectangles[0].BoundingRectangle;

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

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

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

        // Add a callout line pointed at the center of the target phrase
        freeText.SetCallout(PdfAnnotationLineEndingStyle.OpenArrow, calloutRectangle.Center);
    }

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