Skip to main content
.NET Framework 4.5.2+

PdfXYZDestination.Left Property

Gets the X coordinate of a point that is positioned at at the top left corner of the document window.

Namespace: DevExpress.Pdf

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

Declaration

public double? Left { get; }

Property Value

Type Description
Nullable<Double>

The X coordinate in the user coordinate system.

Example

This example shows how to create a bookmark with a destination that displays the page as follows:

bookmark

using System.Collections.Generic;
using DevExpress.Pdf;

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

    // Define search words
    string[] words = { "DX-B5000", "DX-RX800" };

    // Specify search parameters
    PdfTextSearchParameters searchParameters = new PdfTextSearchParameters();
    searchParameters.CaseSensitive = true;
    searchParameters.WholeWords = true;

    foreach (string word in words)
    {
        // Get search results
        PdfTextSearchResults results = documentProcessor.FindText(word, searchParameters);

        // If the text is found, create a destination that positions the found text
        // at the upper window corner
        if (results.Status == PdfTextSearchStatus.Found)
        {
            PdfXYZDestination destination = new PdfXYZDestination(results.Page, 0, results.Rectangles[0].Top, null);

            // Create a bookmark associated with the destination
            PdfBookmark bookmark = new PdfBookmark() { Title = word, Destination = destination };

            // Add the bookmark to the bookmark list
            documentProcessor.Document.Bookmarks.Add(bookmark);
        }
    }
    // Save the modified document
    documentProcessor.SaveDocument(@"..\..\Result.pdf");
}
See Also