OcrOptions

Inheritance: java.lang.Object

public class OcrOptions

Provides the options which are used for OCR Connector.

Constructors

Constructor Description
OcrOptions() Initializes a new instance of the OcrOptions class with default values.
OcrOptions(Rectangle rectangle) Initializes a new instance of the OcrOptions class with rectangular area.
OcrOptions(PagePreviewOptions pagePreviewOptions) Initializes a new instance of the OcrOptions class with page preview options.
OcrOptions(OcrEventHandler handler) Initializes a new instance of the OcrOptions class with OcrEventHandler object.
OcrOptions(Rectangle rectangle, OcrEventHandler handler) Initializes a new instance of the OcrOptions class with rectangular area and OcrEventHandler object.
OcrOptions(Rectangle rectangle, OcrEventHandler handler, boolean useSpellCheker) Initializes a new instance of the OcrOptions class.

Methods

Method Description
getRectangle() Gets the rectangular area that constraints the page area which is used for text recognizing.
getHandler() Gets the event handler to catch OCR events.
getUseSpellChecker() Gets the value that indicates whether the spell checker is used.
getPagePreviewOptions() Gets the page preview options used to render the page that is fed to the OCR engine.
setPagePreviewOptions(PagePreviewOptions pagePreviewOptions) Sets the page preview options used to render the page that is fed to the OCR engine.
getLanguage() Gets the language used for optical character recognition.
setLanguage(Language language) Sets the language used for optical character recognition.
setRectangle(Rectangle rectangle) Sets the rectangular area that constraints the page area which is used for text recognizing.
setHandler(OcrEventHandler handler) Sets the event handler to catch OCR events.
setUseSpellChecker(boolean useSpellChecker) Sets the value that indicates whether the spell checker is used.

OcrOptions()

public OcrOptions()

Initializes a new instance of the OcrOptions class with default values.

OcrOptions(Rectangle rectangle)

public OcrOptions(Rectangle rectangle)

Initializes a new instance of the OcrOptions class with rectangular area.

Parameters:

Parameter Type Description
rectangle Rectangle The rectangular area that constraints the page area which is used for text recognizing.

OcrOptions(PagePreviewOptions pagePreviewOptions)

public OcrOptions(PagePreviewOptions pagePreviewOptions)

Initializes a new instance of the OcrOptions class with page preview options.

Parameters:

Parameter Type Description
pagePreviewOptions PagePreviewOptions The options used to render the page preview which is fed to the OCR engine.

OcrOptions(OcrEventHandler handler)

public OcrOptions(OcrEventHandler handler)

Initializes a new instance of the OcrOptions class with OcrEventHandler object.

Parameters:

Parameter Type Description
handler OcrEventHandler An instance of OcrEventHandler to catch OCR events.

OcrOptions(Rectangle rectangle, OcrEventHandler handler)

public OcrOptions(Rectangle rectangle, OcrEventHandler handler)

Initializes a new instance of the OcrOptions class with rectangular area and OcrEventHandler object.

Parameters:

Parameter Type Description
rectangle Rectangle The rectangular area that constraints the page area which is used for text recognizing.
handler OcrEventHandler An instance of OcrEventHandler to catch OCR events.

OcrOptions(Rectangle rectangle, OcrEventHandler handler, boolean useSpellCheker)

public OcrOptions(Rectangle rectangle, OcrEventHandler handler, boolean useSpellCheker)

Initializes a new instance of the OcrOptions class.

Parameters:

Parameter Type Description
rectangle Rectangle The rectangular area that constraints the page area which is used for text recognizing.
handler OcrEventHandler An instance of OcrEventHandler to catch OCR events.
useSpellCheker boolean The value that indicates whether the spell checker is used.

getRectangle()

public Rectangle getRectangle()

Gets the rectangular area that constraints the page area which is used for text recognizing.

Returns: Rectangle - An instance of Rectangle class that represents the rectangular area that constraints the page area which is used for text recognizing; null if it isn’t set.

getHandler()

public OcrEventHandler getHandler()

Gets the event handler to catch OCR events.

Returns: OcrEventHandler - An instance of OcrEventHandler class which is used to catch OCR events.

getUseSpellChecker()

public boolean getUseSpellChecker()

Gets the value that indicates whether the spell checker is used.

Returns: boolean - true if the spell checker is used; otherwise, false .

getPagePreviewOptions()

public PagePreviewOptions getPagePreviewOptions()

Gets the page preview options used to render the page that is fed to the OCR engine.

Returns: PagePreviewOptions - The PagePreviewOptions, or null if not set.

setPagePreviewOptions(PagePreviewOptions pagePreviewOptions)

public void setPagePreviewOptions(PagePreviewOptions pagePreviewOptions)

Sets the page preview options used to render the page that is fed to the OCR engine.

Parameters:

Parameter Type Description
pagePreviewOptions PagePreviewOptions The page preview options.

getLanguage()

public Language getLanguage()

Gets the language used for optical character recognition.

Returns: Language - The Language enum value. Defaults to Language.Eng.

setLanguage(Language language)

public void setLanguage(Language language)

Sets the language used for optical character recognition.

Parameters:

Parameter Type Description
language Language The Language enum value.

setRectangle(Rectangle rectangle)

public void setRectangle(Rectangle rectangle)

Sets the rectangular area that constraints the page area which is used for text recognizing.

Parameters:

Parameter Type Description
rectangle Rectangle The rectangle, or null to scan the whole page.

setHandler(OcrEventHandler handler)

public void setHandler(OcrEventHandler handler)

Sets the event handler to catch OCR events.

Parameters:

Parameter Type Description
handler OcrEventHandler The event handler.

setUseSpellChecker(boolean useSpellChecker)

public void setUseSpellChecker(boolean useSpellChecker)

Sets the value that indicates whether the spell checker is used.

Parameters:

Parameter Type Description
useSpellChecker boolean true to enable spell checking.