Skip to main content

PdfViewerControl.ContinueSearchFrom Property

Gets or sets where the PDF Viewer continues its search after you scroll a document.

Namespace: DevExpress.Xpf.PdfViewer

Assembly: DevExpress.Xpf.PdfViewer.v21.2.dll

Declaration

public PdfContinueSearchFrom ContinueSearchFrom { get; set; }

Property Value

Type Description
PdfContinueSearchFrom

A PdfContinueSearchFrom enumeration value. The default is CurrentPage.

Available values:

Name Description
CurrentPage

The PDF Viewer continues its search from the current page.

LastSearchResult

The PDF Viewer continues its search from its last search result.

Remarks

The following code snippet shows how to scroll your document to a specific page and continue your search from this page.

pdfViewer.DocumentLoaded += (s, e) =>
{
    // Specify that your search should always continue from the current page.
    pdfViewer.ContinueSearchFrom = DevExpress.Xpf.PdfViewer.PdfContinueSearchFrom.CurrentPage;

    // Specify search options.
    TextSearchParameter parameters = new TextSearchParameter
    {
        CurrentPage = 3,
        IsCaseSensitive = false,
        WholeWord = true,
        Text = "text"
    };

    // Start your search from the third page.
    pdfViewer.FindText(parameters);

    // Process the search results.
    // ...

    // Scroll the document and continue your search from the specified page.
    Dispatcher.BeginInvoke(new Action(() =>
    {
        // Change the current page.
        pdfViewer.CurrentPageNumber = 100;

        // Continue your search.
        pdfViewer.FindText(parameters);
    }), DispatcherPriority.ContextIdle);
};
See Also