Index into matches of the current (active) match, or null if none.
The current (active, highlighted) match, or null if none is selected.
Whether any matches have been found so far.
Whether a search is still scanning pages.
All matches found so far, in page then in-page order. Grows as pages are scanned.
The pattern of the most recent search, or null if none is active.
The 1-based page number currently being scanned, or null before a search
starts. Reaches the last page once scanning completes.
Scan progress in [0, 1] (searched pages / total pages), or null before a search starts.
Subscribes to search-state changes (new matches, current-match moves, progress). Fires on the same events that repaint the viewer highlights.
The callback to invoke when the value changes.
An unsubscribe function.
Releases the searcher: cancels any pending search and drops listeners. Called automatically when the owning viewer creates a new searcher or is disposed. Like resetTextSearch but does not notify listeners.
The [start, end) slice of matches that belongs to a page (1-based),
or null if the page has not been scanned yet. Used by the viewer to paint
per-page highlights.
The 1-based page number.
The resolved or null.
Makes the match at index current and asks the viewer to bring it into
view (via PdfrxViewer.ensureVisiblePageRect).
The 0-based index.
index, or -1 if it is out of range.
Makes the next match current and scrolls it into view. From no selection, starts at the first match.
The new current index, or -1 if already at the last match.
Makes the previous match current and scrolls it into view. From no selection, wraps to the last match.
The new current index, or -1 if already at the first match.
Clears the current matches and pattern, and repaints (notifies listeners).
Starts a new search, cancelling any in-flight one. Debounced by 500ms unless StartTextSearchOptions.searchImmediately is set, so it is cheap to call on every keystroke. Pages are scanned progressively and matches grows as they complete; re-searching the identical pattern is a no-op, and an empty pattern resets the search.
Literal string or RegExp to search for.
Options that customize the operation.
Interactive full-text search over a document, with progressive per-page scanning and current-match tracking. Obtain one from PdfrxViewer.createTextSearcher; the owning viewer paints the match highlights (all matches plus the current match in a distinct color) and scrolls to matches as you navigate.
Example