OcrOptions
Leave feedback
On this page
Inheritance: java.lang.Object
public class OcrOptions
Provides the options which are used for OCR Connector.
| 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. |
| 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. |
public OcrOptions()
Initializes a new instance of the OcrOptions class with default values.
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. |
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. |
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. |
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. |
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. |
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.
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.
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 .
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.
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. |
public Language getLanguage()
Gets the language used for optical character recognition.
Returns: Language - The Language enum value. Defaults to Language.Eng.
public void setLanguage(Language language)
Sets the language used for optical character recognition.
Parameters:
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. |
public void setHandler(OcrEventHandler handler)
Sets the event handler to catch OCR events.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| handler | OcrEventHandler | The event handler. |
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. |
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.