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
pagePageElementThe page to search. Must not be
null.querystringThe text to search for. Must not be
null.textOptionsTextSearchOptionsOptions to control comparison behavior (case, whole word, max results, context size). May be
nullfor defaults.
Returns
Exceptions
- ArgumentNullException
Thrown when
pageorqueryisnull.
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
pagesIEnumerable<PageElement>Pages to search. Must not be
null.querystringText to search for. Must not be
null.textOptionsTextSearchOptionsOptions to control comparison behavior. May be
nullfor defaults.
Returns
Exceptions
- ArgumentNullException
Thrown when
pagesorqueryisnull.