TextFragment class
Leave feedback
On this page
Represents a part of recognized text (word, symbol, etc), extracted by an OCR engine.
Learn more:
- More details about using OCR in GroupDocs.Redaction: https://docs.groupdocs.com/redaction/python-net/ocr-usage-basics/
The TextFragment type exposes the following members:
| Constructor | Description |
|---|---|
| init | Initializes a recognized text fragment. |
| Method | Description |
|---|---|
| to_string | Returns textual content of the recognized text fragment. |
| Property | Description |
|---|---|
| bounding_rectangle | The bounding rectangle of the recognized text fragment; this property is obsolete, use TextFragment.rectangle instead. |
| rectangle | The bounding rectangle of the recognized text fragment. |
| text | The textual content of the recognized text fragment. |
from groupdocs.redaction.integration.ocr import TextFragment
from groupdocs.redaction.options.drawing import Rectangle
fragment = TextFragment("Emily Johnson", Rectangle(40, 40, 230, 40))
Task guides that use TextFragment:
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.