CPDFTextSearcher class viewer-ui
Text search helper for a PDF document.
This class communicates with the native viewer via a MethodChannel bound
to a specific viewId.
Typical usage:
- Call searchText to search for keywords and populate searchResults.
- Call selection to highlight/select a specific result.
- Call clearSearch to clear current results and native search state.
Notes:
- Each CPDFTextSearcher instance is tied to the viewer identified by the
viewIdpassed to the constructor. - Search results are cached in-memory and updated on each searchText call.
Constructors
- CPDFTextSearcher(int viewId)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchResults → dynamic
-
no setter
Methods
-
clearSearch(
) → Future< void> - Clears the current search results. This method clears the list of search results and resets the search state.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
searchText(
String keywords, {dynamic searchOptions = CPDFSearchOptions.caseInsensitive}) → Future< List< CPDFTextRange> > - Searches for text in the PDF document. This method allows you to search for specific keywords in the PDF document and returns a list of text ranges where the keywords are found.
-
selection(
CPDFTextRange range) → Future< void> - Selects a specific text range in the PDF document. This method allows you to select a text range based on the provided
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited