COcr library
The COcr Library provides basic text extraction from an image file. The image file format must have a resolution of 300 dpi. The image may be in either color or a black and white color scheme. The following sections describe the COcr Library properties and functions.
InitLibrary
Section titled “InitLibrary”Initializes the COcr library. This function must be called before calling any other function in the library.
Syntax
InitLibrary(License As String) As LongParameters
| Parameter | Description |
|---|---|
| [in] License | Null-terminated string that contains license key value |
Return Values
| Value | Description |
|---|---|
| LICENSE_VALID | License valid; library ready for use |
| LICENSE_INVALID | License invalid; all scanner operations disabled |
| LICENSE_EXPIRED | License expired; all scanner operations disabled |
| LICENSE_DOES_NOT_MATCH_LIBRARY | License invalid; all scanner operations disabled for this library |
| GENERAL_ERR_PLUG_NOT_FOUND | Returned if the attached scanner is not one of the following scanners: ScanShell 600 | ScanShell 800 |. ScanShell 1000 |
ExtractText
Section titled “ExtractText”Extracts bulk text from an image (up to 4K (4096) characters)
Syntax
ExtractText( _ SourceImage As String, _ TextType As Long, _ )Parameters
| Parameter | Description |
|---|---|
| [in] SourceImage | Full path name of the original image. |
| [in] TextType | Instructs the OCR what type of data is written in the image. This value increases the detection accuracy and speeds up the OCR operation. This value can be one of the following values: |
Return Values
| Value | Description |
|---|---|
| TOCR_SUCCESS | Function succeeded |
| LICENSE_INVALID | License invalid; library not initialized with proper license |
| TOCRJOBERROR | OCR engine unable to accomplish the detection process correctly |
| TOCR_BAD_TYPE | Bad TextType value |
ExtractTextEx
Section titled “ExtractTextEx”Extracts bulk text from an image (up to 4K (4096) characters). This function uses a different method than ExtractText to process the image file, resulting in a longer processing time but with higher accuracy. This function is recommended for use with a complex document structure where processing time is not critical.
Syntax
ExtractTextEx(SourceImage As String)Parameters
| Parameter | Description |
|---|---|
| [in] SourceImage | Full path name of the original image. |
| [in] TextType | Instructs the OCR what type of data is written in the image. This value increases the detection accuracy and speeds up the OCR operation. This value can be one of the following values: |
Return Values
| Value | Description |
|---|---|
| TOCR_SUCCESS | Function succeeded |
| LICENSE_INVALID | License invalid; library not initialized with proper license |
| TOCRJOBERROR | OCR engine unable to accomplish the detection process correctly |
| TOCR_BAD_TYPE | Bad TextType value |