Skip to main content

Surface Actions: Configure OCR provider

  1. In the step, click Configure.. , the Surface Actions dialog appears.
Surface Actions Configure Provider dialog
  1. In the Tool list, select the OCR provider from the list. Available options are:
  • Tesseract
  • Google Vision
  • Microsoft Azure
OCR provider selection dropdown with Tesseract, Google Vision, and Microsoft Azure
  1. The configuration fields will change depending on the tool you select: Tesseract
Important

Before configuring Tesseract, download the required locale (.traineddata) file from the web. The System Administrator can upload the file through File Management → Files on the AutomationEdge Server. English language is available by default.

For Tesseract, configure the following field details:

Field NameDescription
LocaleSelect the required language for OCR processing from the list.
The field is mandatory.

Notes:
• By default, only the English language file, that is, eng.traineddata is included in the tool.
• To support other language(s) in the Locale list, place additional language files in the tessdata folder within the folder where the JAR is placed.
For example, hin.traineddata for Hindi. The languages of added files will be available in the Locale list.
• Make sure the language file follows the format and is compatible with Tesseract OCR.

Allowed format: <lang-code>.traineddata

For details, see: https://github.com/tesseract-ocr/tessdata/tree/main

Google Vision

For Google Vision, configure the following field details:

Tool list showing Google Vision

Figure 3: Tool list: Google Vision

References:

https://cloud.google.com/docs/authentication/api-keys#api_key_restrictions

  • Create a service account and download its JSON key:

https://cloud.google.com/iam/docs/keys-create-delete

For Google Vision, the following field will be available to configure:

FieldnameDescription
Auth TypeSelect how you want to sign in to Google Vision:
API Key (default): Use a single Google Cloud Vision API key.
JSON Credentials: Use a Google service account key file.
The fields below Auth Type change depending on your selection.
Note: If you saved a workflow before this field was introduced, the workflow opens with API Key selected. It continues to run without any changes.
The field is mandatory.
Auth Type: API KeyAuth Type set to API Key
Api KeySpecify a valid Google Cloud Vision API key.
If the checkbox Accept Value as variable/static is selected, then the password field appears as a text box and accepts static or variable values.
OR
If the checkbox Accept Value as variable/static is not selected, then the password field appears as a dropdown in which you can select a field from the previous steps
The field is mandatory.
Auth Type: JSON CredentialsAuth Type set to JSON Credentials
JSON CredentialsPaste the full contents of the service account key file (.json) that you download from Google.

Or,
Click Browse.. button, then select the file from your local system. The file contents appear automatically.
For example:
{ "type": "service_account", "project_id": "my-project", "private_key": "-----BEGIN PRIVATE KEY-----...", "client_email": "ocr-user@my-project.iam.gserviceaccount.com", "token_uri": "https://oauth2.googleapis.com/token" }
Notes:
• This field appears only when Auth Type is set to JSON Credentials.
• The action uses only the client_email, private_key, and token_uri values from the file. Provide the complete file as downloaded — the action ignores the other entries.
• Use Browse.. button to select the JSON credential file. The private key is one very long line and can get changed by accident during copy and paste.
• The platform stores this value in encrypted form in the workflow file.
• If the value isn't a valid service account file, you see the message Received invalid JSON Credentials when you select OK.
• This field doesn't support environment variables.
The field is mandatory.
Feature TypeSelect or specify the type of text recognition to be used by Google Vision.
Available types are:
TEXT_DETECTION: (Default) Use for scattered text on a screen, such as buttons, field labels, menu items and messages.
DOCUMENT_TEXT_DETECTION: Use for dense text such as scanned pages, invoices, forms, contracts and handwriting. The line and paragraph order of the document is retained.
Notes:
• If the field is left blank, TEXT_DETECTION is used.
• You can specify both types together, separated by a comma — for example, TEXT_DETECTION, DOCUMENT_TEXT_DETECTION. The step returns a single combined text value. Google charges separately for each type you specify.
• Only the two types listed above return text. If you specify any other Google Vision feature type, the step returns an empty result without an error.
ModelSelect or specify the Google Vision model version you want to use.
builtin/latest (default): Uses the newest available model. Accuracy improves over time, but results for the same image can change when Google updates the model.
builtin/stable: Uses a fixed model version, so the same image gives the same result over time. Use this option if you process the extracted text further using a fixed pattern or rule.
Notes:
• If the field is left blank, builtin/latest is used.
• Google currently supports builtin/latest and builtin/stable.
• The field stays editable so that a new model name published by Google can be used.
• Unsupported values return an error, and the step fails.
LocaleSpecify the language code, for example, en, or a BCP 47 language tag — for example, en-US.
Notes:
• If you leave it blank, Google Vision detects the language automatically.
• Specify a value only if Google Vision doesn't detect the language correctly.
Reference link: https://cloud.google.com/translate/docs/languages


Microsoft Azure

For Microsoft Azure, configure the following field details:

Note: Azure does not accept images smaller than 50 × 50 pixels. If the selected region is smaller, the step automatically adds a white border to reach the required size. The behavior applies when the step reads text for an action such as Read Text. The behavior does not apply when text is read back with Verify Entered Text set to Yes for a Write Text action. In such cases, Azure rejects regions smaller than 50 × 50 pixels.

Tool list showing Microsoft Azure

Figure 4: Tool list- Microsoft Azure

To create resources, see: https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/how-to-guides/create-document-intelligence-resource?view=doc-intel-4.0.0

For Microsoft Azure, the following field will be available to configure:

FieldnameDescription
Api KeySpecify valid Azure Document Intelligence service key.
Example: 4f2a8c9e1b7d4e3a9c6f0d2b5a8e1c47
If the checkbox Accept Value as variable/static is selected, then the password field appears as a text box and accepts static or variable values.
OR
If the checkbox Accept Value as variable/static is not selected, then the password field appears as a dropdown in which you can select a field from the previous steps
The field is mandatory.
API EndpointSpecify the valid Document Intelligence service endpoint.
Example: https://my-doc-intel-resource.cognitiveservices.azure.com/
If the checkbox Accept Value as variable/static is selected, then the password field appears as a text box and accepts static or variable values.
OR
If the checkbox Accept Value as variable/static is not selected, then the password field appears as a dropdown in which you can select a field from the previous steps
The field is mandatory.
API VersionSpecify the Azure Document Intelligence API version you want to use. The API version is a date-based string: YYYY-MM-DD ,for example, 2024-11-30.
Notes:
• If the field is left blank, the step uses the default value
• Use a generally available (GA) version. Microsoft retires preview versions, and they stop working after the retirement date.
Default value: 2024-11-30
The field accepts variable, static values or previous step field
LocaleSpecify the language code, for example, en, or a BCP 47 language tag, for example, en-US.
The field is mandatory.
For the list of supported languages, see:
Azure Document Intelligence language support.