This function executes OCR on the image data specified by an image file

[C++Builder/Visual C++]     BOOL IKOCRImageFile(LPCTSTR ImageFile, LPCTSTR language, LPCTSTR OcrTextFile);
[Delphi]         function IKOCRImageFile(ImageFile, language, OcrTextFile: LPCTSTR): LongBool; cdecl;
[Visual Basic]   Function IKOCRImageFile(ByVal ImageFile As String, ByVal language As String, ByVal OcrTextFile As String) As Long

Parameters

Name Explanation
ImageFile The file name of the image to be converted to text
language The language used for text recognition during OCR. The setting value is a BCP-47 language tag (e.g., 'ja', 'en', 'zh', etc.).
OcrTextFile The text file into which the converted text data will be saved

Return Value

Returns True (nonzero) if successful. Returns False (0) if unsuccessful.

Explanation

The IKOCRImageHandle function executes OCR on the image data specified by an image file set in the ImageFile parameter.

When OCR is executed using IK10OCR.dll or IK10OCR64.dll, the OcrTextFile will be in UTF-8 format.
When OCR is executed using IK10OCRA.dll or IK10OCR64A.dll, the OcrTextFile will be in ANSI format.

Code Example

(1) C++Builder/Visual C++
   BOOL hr = IKOCRImageFile("Image.jpg", _T("ja"), _T("OCRtextfile.txt"));

(2) Delphi
   var
      hr: LongBool;
   begin
      hr := IKOCRImageFile('Image.jpg', 'ja', 'OCRtextfile.txt');
   end;

(3) Visual Basic
   Ret = IKOCRImageFile("Image.jpg", "ja", "textfile.txt")

 

The ImageKit10 ActiveX is a product created by Newtone Corporation