Visual Components Sample (Windows)

Language:
EN
Product-Line:
FineReader Engine
Version:
10, 11, 12
Platform:
Windows
KB-Type:
Code Samples Collection
Category:
OCR: Speed & Quality, Verification & User Interaction
Coding:
C#, C++ COM, Visual Basic .NET
Image:
image: icon_userinterface.gif

This sample illustrates all the steps you need to perform to create a simple application with graphical user interface similar to that of ABBYY FineReader. The sample allows you to open an image, recognize it, verify recognition results and save recognized text in RTF format.

Description

 Precompiled Sample 'Visual Components'

The sample uses ABBYY FineReader Engine Visual Components to display an image and recognized text and basic objects and methods of ABBYY FineReader Engine API to process the image. Do the following:

  1. Add necessary Visual Components to the form of your application. The sample uses ImageViewer, ZoomViewer, DocumentViewer, and TextEditor components on the main form.
  2. In order these components can work synchronously, connect them to the ComponentSynchronizer object using corresponding properties of the object.
  3. To open an image file:
    1. Create the Engine object using the GetEngineObject function (version 10, 11) or the InitializeEngine function (version 12).
    2. Call the CreateFRDocument method of the Engine object to create the FRDocument object.
    3. Add pages from an image file to the document. Use the AddImageFile method of the FRDocument object.
    4. Attach the opened image to Visual Components using the Document property of the ComponentSynchronizer object.
  4. To recognize the file using FineReader Engine API:
    1. [optional] Create the DocumentProcessingParams object and set the page processing parameters (for preprocessing, analysis, and recognition) and document synthesis parameters.
    2. Call the Process method of the FRDocument object.
      The recognition process can also be invoked using the commands available in the ImageViewer or DocumentViewer.
  5. To check recognition results:
    1. You can create a new form for TextValidator component or add it to the existing form.
    2. Attach the TextValidator component to the ComponentSynchronizer object. Use the TextValidator property of the ComponentSynchronizer object.
    3. Call the Spell method of the TextValidator object to start spell checking.
      The same process can be invoked using the Check Spelling button in the TextEditor.
  6. To save recognized text:
    1. [optional] Create an export parameter object of the type you need. The type of this object depends on the format of the output file you would like to use (FileExportFormatEnum). The default object values are the ones used most frequently, but you may set the export parameters as you like.
    2. Call the Export method of the FRDocument object to save the document into a file of the specified format.
    3. Call the Close method of the FRDocument object to release resources.
      Note that the process of export can be invoked using the commands available in the DocumentViewer.
  7. To unload ABBYY FineReader Engine use the DeinitializeEngine function.

—-

Back To:

This website uses cookies which enable you to see pages or use other functions of our websites. You can turn off such cookies in your browser’s settings. If you continue to use these pages, you consent to the use of cookies.