First of all, if you use C++ or Delphi, you need to create an instance of the TNSOCR class and pass the correct path and filename to the "NSOCR.dll" file to the class constructor. If you use NSOCR via COM in C# or VB.NET, just add a reference to the NSOCR COM library.
Before using the NSOCR engine, initialize it, create OCR-related objects, and load the OCR settings. To do that, use the Engine_InitializeAdvanced
function. When you do not need the NSOCR library anymore, call the Engine_Uninitialize function, which will release all allocated memory and resources.
Call these functions only once in your application, even if you need to recognize a lot of images.
Here are the typical steps of using NSOCR to recognize text in an image file:
Call the Engine_InitializeAdvanced function to initialize the NSOCR library, create objects, and load the configuration.
Call the Img_LoadFile function to load the image file.
Call the Img_GetImgText function to get the recognized text.
Call the Engine_Uninitialize function to release the created objects and uninitialize the NSOCR library.
Each NSOCR function can return an error code. To debug your code more easily, check the error codes returned by functions.
The Nicomsoft OCR SDK contains demo projects with complete source code for various programming languages (C#, C++, VB.NET, Java, Delphi, and C++ Builder). Please check the "Samples" directory for details.