SearchResult class
Leave feedback
On this page
Represents the search result in the search functionality.
An instance of SearchResult class is used as return value of Parser.search and Parser.search methods. See the usage examples there.
The SearchResult type exposes the following members:
| Property | Description |
|---|---|
| left_highlight_item | The left highlight item. |
| page_index | The page index where the text is found. Zero-based index of the page where the text is found; None if the search is performed on the whole document text. |
| position | The position in the document text. |
| right_highlight_item | The right highlight item. |
| text | The text of the search result. |
from groupdocs.parser import Parser
with Parser("./sample.pdf") as parser:
search_results = parser.search("lorem")
if search_results is None:
print("Search isn't supported")
else:
for result in search_results:
print(f"At {result.position}: {result.text}")
- module
groupdocs.parser.data
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.