Skip to main content
All docs
V25.1
  • PdfPageFacade.CreateFitVerticallyDestination() Method

    Creates a FitV destination. The coordinate of the document window’s top left corner is retained from the previous view.

    Namespace: DevExpress.Pdf

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

    NuGet Package: DevExpress.Pdf.Core

    Declaration

    public PdfFitVerticallyDestination CreateFitVerticallyDestination()

    Returns

    Type Description
    PdfFitVerticallyDestination

    The destination on the page.

    Remarks

    The code sample below creates a link annotation with a destination that displays the fifth page as follows:

    link annotation

    using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
    {
        // Load a document
        pdfDocumentProcessor.LoadDocument("Documents//Demo.pdf");
    
        // Access fifth page properties
        PdfPageFacade pageFacade = pdfDocumentProcessor.DocumentFacade.Pages[5];
    
        // Create a FitV destination that refers to the fifth page
        PdfFitVerticallyDestination destination =
          pageFacade.CreateFitVerticallyDestination();
    
        // Find a specific phrase
        PdfTextSearchResults textSearchResults = pdfDocumentProcessor.FindText("Patterns");
    
        // If the phrase is found, obtain the page that contains it
        // and the top vertical coordinate of the phrase's rectangle
        if (textSearchResults.Status == PdfTextSearchStatus.Found)
        {
            PdfPageFacade linkPageFacade =
               pdfDocumentProcessor.DocumentFacade.Pages[textSearchResults.PageNumber-1];
            PdfRectangle linkRectangle =
              textSearchResults.Rectangles[0].BoundingRectangle;
    
            // Create a link annotation associated with the bounding rectangle
            // and destination
            PdfLinkAnnotationFacade linkAnnotation =
               linkPageFacade.AddLinkAnnotation(linkRectangle, destination);
            linkAnnotation.HighlightMode = PdfAnnotationHighlightingMode.Push;
        }
        // Save the result
        pdfDocumentProcessor.SaveDocument("out.pdf");
    }
    
    See Also