Skip to main content
Version: v6.5.0

Image OCR recognition

Command Description

OCR identification of the specified image requires access to the Internet when calling

Command Prototype

sText = MicrosoftOCR.ImageOCR(sFileName, sUrl, sApiKey)

Command parameter

parametermandatorytypedefault valueInstructions
sFileNameTruepath''' C:\Users'''The recognized image path supports JPEG, PNG, BMP, PDF, and TIFF formats, and the image size must be less than 50M
sUrlTruestring""Please log in to Microsoft Azure, find Keys and Endpoint in the created computer vision resource, copy Endpoint and fill in
sApiKeyTruestring""Please copy the API Key from Keys and endpoints on Microsoft Cognitive Services

Return result

SText, Assign the result of running the command to this variable.

Run instance

/*********************************Image OCR Recognition*************************************
Command Prototype:
sText = MicrosoftOCR.ImageOCR(sFileName, sUrl, sApiKey)
Input Parameters:
sFileName -- The image to be recognized. Note: The path of the image to be recognized. Supports jpeg, png, bmp, pdf, tiff formats. The image size must be less than 50M.
sUrl -- Endpoint. Note: Please log in to Microsoft Azure, find the Keys and Endpoint in the created Computer Vision resource, copy the Endpoint, and enter it here.
sApiKey -- API Key. Note: Please copy the API Key from the Keys and endpoints section on Microsoft Cognitive Services.
Output Parameter:
sText -- The variable where the output of the function call will be saved.
Notes:
None
********************************************************************************/
Dim sText = ""
sText = MicrosoftOCR.ImageOCR('''C:\Users''', "", "")
TracePrint(sText)