TextOptions

Inheritance: java.lang.Object

public class TextOptions

Provides the options which are used for text extraction.

An instance of TextOptions class is used as parameter in Parser.getText(TextOptions) and Parser.getText(int, TextOptions) methods. See the usage examples there.

It’s used to specify the raw mode of text extraction. A text in this mode is extracted in a non-accurate way but faster than in the standard mode. If the raw mode doesn’t support the document format, then this parameter is ignored and the standard mode is used.

Learn more:

Constructors

Constructor Description
TextOptions(boolean useRawModeIfPossible) Initializes a new instance of the TextOptions class.
TextOptions(boolean useRawModeIfPossible, boolean useOcr) Initializes a new instance of the TextOptions class with the OCR usage option.
TextOptions(boolean useRawModeIfPossible, boolean useOcr, OcrOptions ocrOptions) Initializes a new instance of the TextOptions class with the ability to set OCR options.

Methods

Method Description
isUseRawModeIfPossible() Gets the value that indicates whether the raw mode is used.
isUseOcr() Gets the value that indicates whether the OCR Connector is used to extract a text.
getOcrOptions() Gets the additional options for OCR functionality.

TextOptions(boolean useRawModeIfPossible)

public TextOptions(boolean useRawModeIfPossible)

Initializes a new instance of the TextOptions class.

Parameters:

Parameter Type Description
useRawModeIfPossible boolean The value that indicates whether the raw mode is used.

TextOptions(boolean useRawModeIfPossible, boolean useOcr)

public TextOptions(boolean useRawModeIfPossible, boolean useOcr)

Initializes a new instance of the TextOptions class with the OCR usage option.

Parameters:

Parameter Type Description
useRawModeIfPossible boolean The value that indicates whether the raw mode is used.
useOcr boolean The value that indicates whether the OCR functionality is used to extract a text.

TextOptions(boolean useRawModeIfPossible, boolean useOcr, OcrOptions ocrOptions)

public TextOptions(boolean useRawModeIfPossible, boolean useOcr, OcrOptions ocrOptions)

Initializes a new instance of the TextOptions class with the ability to set OCR options.

Parameters:

Parameter Type Description
useRawModeIfPossible boolean The value that indicates whether the raw mode is used.
useOcr boolean The value that indicates whether the OCR functionality is used to extract a text.
ocrOptions OcrOptions The additional options for OCR functionality.

isUseRawModeIfPossible()

public boolean isUseRawModeIfPossible()

Gets the value that indicates whether the raw mode is used.

Returns: boolean - true if the raw mode is used; otherwise, false .

isUseOcr()

public boolean isUseOcr()

Gets the value that indicates whether the OCR Connector is used to extract a text.

Returns: boolean - true if the OCR functionality is used; otherwise, false .

getOcrOptions()

public OcrOptions getOcrOptions()

Gets the additional options for OCR functionality.

Returns: OcrOptions - An instance of OcrOptions class with the additional OCR options.