TextOptions class

TextOptions class

Provides the options which are used for text extraction.

An instance of TextOptions is used as a parameter in Parser.get_text and Parser.get_text methods. See the usage examples there.

It specifies the raw mode of text extraction. Text in this mode is extracted in a non‑accurate way but faster than in the standard mode. If raw mode doesn’t support the document format, this option is ignored and the standard mode is used.

The TextOptions type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the TextOptions class.
init Initializes a new TextOptions instance.
init Initializes a new TextOptions instance with the OCR usage option.
init Initializes a new TextOptions instance with OCR options support.

Properties

Property Description
include_annotations The value indicating whether annotations are included.
ocr_options The additional OCR options for text extraction.
use_ocr The value indicates whether the OCR Connector is used to extract text. Returns True if the OCR functionality is used; otherwise False.
use_raw_mode_if_possible The value indicating whether raw mode is used. True if raw mode is used; otherwise, False.

Example

from groupdocs.parser import Parser
from groupdocs.parser.options import TextOptions

parser = Parser("sample.docx")
options = TextOptions()  # use raw mode
text = parser.get_text(options)
print(text)

See Also