Back to Devexpress

PdfViewerControl.ContinueSearchFrom Property

wpf-devexpress-dot-xpf-dot-pdfviewer-dot-pdfviewercontrol-a8c0c8c2.md

latest3.8 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Wpf.PdfViewer

Declaration

csharp
public PdfContinueSearchFrom ContinueSearchFrom { get; set; }
vb
Public Property ContinueSearchFrom As PdfContinueSearchFrom

Property Value

TypeDescription
PdfContinueSearchFrom

A PdfContinueSearchFrom enumeration value. The default is CurrentPage.

|

Available values:

NameDescription
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.

csharp
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);
};
vb
AddHandler pdfViewer.DocumentLoaded, Sub(s, e)
            ' Specify that your search should always continue from the current page.
            pdfViewer.ContinueSearchFrom = DevExpress.Xpf.PdfViewer.PdfContinueSearchFrom.CurrentPage

            ' Specify search options.
            Dim parameters As TextSearchParameter = New TextSearchParameter With {
                .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(Sub()
                                        ' Change the current page.
                                        pdfViewer.CurrentPageNumber = 100

                                        ' Continue your search.
                                        pdfViewer.FindText(parameters)
                                  End Sub), DispatcherPriority.ContextIdle)
End Sub

See Also

FindText(TextSearchParameter)

PdfViewerControl Class

PdfViewerControl Members

DevExpress.Xpf.PdfViewer Namespace