ImageEn, unit iexUserInteractions

TIEPdfViewerInteraction.Find

TIEPdfViewerInteraction.Find


Declaration

function Find(const s: string; MatchCase: Boolean = False; MatchWholeWord: Boolean = False; FromEnd: Boolean = False; DoSelect: Boolean = True; AllPages: Boolean = False): Boolean;


Description

Commence a search for text in the current page.
Parameter Description
s The text to search for
MatchCase Enable for a case sensitive search
MatchWholeWord Enable to require the search text to match the whole word
FromEnd Enable to start at the bottom of the page and search upward
DoSelect If enabled, the search is performed and the first instance is marked in the document. If False, the search is non-visual and you should use FindNext to find the first instance and return location information
AllPages If the search text is not found on the current page, the remainder of the document will be searched until the item is found (see note below)

Result is False if there are no instances of the search text.

Notes:
- You can use ClearSelection to clear the selected text
- When searching all pages, OnProgress will report what percentage of all pages have been searched. OnFinishWork will occur after searching completes


Demo

Demo  Demos\Other\PdfViewer\PdfViewer.dpr


Example

// Find and select the text "Adobe"
ImageEnView1.PdfViewer.Find( 'Adobe' );

// Get the location of the "Adobe" (non-visual)
ImageEnView1.PdfViewer.Find( 'Adobe', False, False, False );
ImageEnView1.PdfViewer.FindNext( idx, cnt, False, False );
ShowMessage( format( 'Index: %d, Count: %d', [ idx, cnt ]);


See Also

- CanFindNext
- FindNext
- FindDialog
- ClearSelection