PdfPageFacade.CreateFitBBoxHorizontallyDestination() Method
In This Article
Creates a FitBH destination. The coordinate of the document window’s top left corner is retained from the previous view.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Pdf.v24.2.Core.dll
NuGet Package: DevExpress.Pdf.Core
#Declaration
public PdfFitBBoxHorizontallyDestination CreateFitBBoxHorizontallyDestination()
#Returns
Type | Description |
---|---|
Pdf |
The Fit |
#Remarks
The code sample below creates a link annotation with a destination that displays the first page’s area as follows:
using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
{
// Load a document
pdfDocumentProcessor.LoadDocument("Roll Paper.pdf");
// Access the first page properties
PdfPageFacade pageFacade = pdfDocumentProcessor.DocumentFacade.Pages[0];
// Create a FitBH destination that refers to the first page
PdfFitBBoxHorizontallyDestination destination =
pageFacade.CreateFitBBoxHorizontallyDestination();
// Find a specific phrase
PdfTextSearchResults linkText = pdfDocumentProcessor.FindText("Go to Total");
// If the phrase is found, obtain its bounding rectangle
if (linkText.Status == PdfTextSearchStatus.Found)
{
PdfRectangle linkRectangle = linkText.Rectangles[0].BoundingRectangle;
// Create a link annotation associated with the bounding rectangle
// and destination
PdfLinkAnnotationFacade linkAnnotation =
pageFacade.AddLinkAnnotation(linkRectangle, destination);
linkAnnotation.HighlightMode = PdfAnnotationHighlightingMode.Push;
}
// Save the result
pdfDocumentProcessor.SaveDocument("out.pdf");
}
See Also