Method FindText
FindText(PageElement, string, TextSearchOptions)
Finds exact (substring) matches of query
within a page's text, honoring textOptions
.
Results include the matched text, a context snippet, the union bounding box, and contributing elements.
Normalization (whitespace/diacritics/optional char-stripping) is applied to both the page text and the query.
public List<TextMatch> FindText(PageElement page, string query, TextSearchOptions textOptions = null)
Parameters
page
PageElementThe page to search. Must not be
null
.query
stringThe text to search for. Must not be
null
.textOptions
TextSearchOptionsOptions to control comparison behavior (case, whole word, max results, context size). May be
null
for defaults.
Returns
Exceptions
- ArgumentNullException
Thrown when
page
orquery
isnull
.
FindText(IEnumerable<PageElement>, string, TextSearchOptions)
Finds exact matches across multiple pages
and annotates each result with its page index.
public List<TextMatch> FindText(IEnumerable<PageElement> pages, string query, TextSearchOptions textOptions = null)
Parameters
pages
IEnumerable<PageElement>Pages to search. Must not be
null
.query
stringText to search for. Must not be
null
.textOptions
TextSearchOptionsOptions to control comparison behavior. May be
null
for defaults.
Returns
Exceptions
- ArgumentNullException
Thrown when
pages
orquery
isnull
.