- Use color pictures with an optimal resolution of 300 dpi.
- Tune the recognition speed using profiles (see Working with Profiles for details).
Scenario implementation
The code samples provided in this topic are Windows -specific.
Step 1. Loading ABBYY FineReader Engine
Step 1. Loading ABBYY FineReader Engine
To start your work with ABBYY FineReader Engine, you need to create the Engine object. The Engine object is the top object in the hierarchy of the ABBYY FineReader Engine objects and provides various global settings, some processing methods, and methods for creating the other objects.To create the Engine object, you can use the InitializeEngine function. See also other ways to load Engine object (Win).
C#
C++ (COM)
Step 2. Loading settings for the scenario
Step 2. Loading settings for the scenario
The most suitable settings can be selected by using the LoadPredefinedProfile method of the Engine object. This method accepts the name of the settings profile being used as an input parameter. For more about profiles, see Working with Profiles.ABBYY FineReader Engine supports 2 variants of settings for this scenario:
If you wish to change the settings used for processing, use the corresponding parameter objects. See the Additional optimization section below for more information.
| Profile name | Description |
|---|---|
| BarcodeRecognition\_Accuracy | Extracts only barcodes (texts, pictures, or tables are not detected). The settings have been optimized for accuracy. <Warning> This profile requires the Barcode Autolocation module available in the license. </Warning> |
| BarcodeRecognition\_Speed | Extracts only barcodes (texts, pictures, or tables are not detected). The settings have been optimized for processing speed. <Warning> This profile requires the Barcode Autolocation module available in the license. </Warning> |
C#
C++ (COM)
Step 3. Loading and preprocessing the images
Step 3. Loading and preprocessing the images
ABBYY FineReader Engine provides a FRDocument object for processing multi-page documents. To load the images of a document and preprocess them, you should create the FRDocument object and add images to it. You can do one of the following:
- Create an FRDocument object using the CreateFRDocumentFromImage method of the Engine object. This method creates an FRDocument object and loads images from a specified file.
- Create an FRDocument object with the help of the CreateFRDocument method of the Engine object, then add the images into the created FRDocument object from a file (use the AddImageFile, AddImageFileWithPassword, or AddImageFileWithPasswordCallback method of the FRDocument object).
C#
C++ (COM)
Step 4. Extracting barcodes
Step 4. Extracting barcodes
If the BarcodeRecognition profile is loaded, you can use the Process method of the FRDocument object to extract only barcodes. In this case, ABBYY FineReader Engine detects only blocks with barcodes. No other blocks are detected. The recognized barcode blocks can be accessed via the Layout object, which is a subobject of the FRPage object representing a page of the document.To read barcodes of specific type, specify the appropriate parameters of the BarcodeParams object and pass the BarcodeParams object as a parameter of one of the above functions.
C#
C++ (COM)
Step 5. Exporting the recognized data
Step 5. Exporting the recognized data
To save the values of the recognized barcodes to a file, you may use the Export method of the FRDocument object by assigning the FileExportFormatEnum constant as one of the parameters. This scenario can export, for example, to TXT. You may change the default parameters of export using the corresponding export object. Please see Additional optimization for specific tasks below for further information.After you have finished your work with the FRDocument object, release all the resources that were used by this object. Use the IFRDocument::Close method.
C#
C++ (COM)
Step 6. Unloading ABBYY FineReader Engine
Step 6. Unloading ABBYY FineReader Engine
After finishing your work with ABBYY FineReader Engine, you need to unload the Engine object. To do this, use the DeinitializeEngine exported function.
C#
C++ (COM)
Required resources
You can use the FREngineDistribution.csv file to automatically create a list of files required for your application to function. For processing with this scenario, select in the column 5 (RequiredByModule) the following values: Core Core.Resources Opening Opening, Processing Processing Processing.OCR Processing.OCR, Processing.ICR Processing.OCR.NaturalLanguages Processing.OCR.NaturalLanguages, Processing.ICR.NaturalLanguages Export Export, Processing If you modify the standard scenario, change the required modules accordingly. You also need to specify the interface languages, recognition languages and any additional features which your application uses (such as, e.g., Opening.PDF if you need to open PDF files, or Processing.OCR.CJK if you need to recognize texts in CJK languages). See Working with the FREngineDistribution.csv File for further details.Additional optimization
These are the sections of the help file where you can find additional information about setting up the parameters for the various processing stages:- Extracting and reading barcodes
- BarcodeParams Object
This object allows you to set up the barcode analysis and reading parameters. - Recognizing Barcodes
Discusses special cases in barcode recognition and provides hints on working with barcodes. - Barcode Types
The list of barcodes supported in ABBYY FineReader Engine 12 and their brief descriptions. - FRDocument Object
Apart from barcode values, you may need to extract other information contained in document. In this case, you may wish to use the methods of the FRDocument object. - PageProcessingParams Object
This object allows you to set up analysis and recognition parameters for the entire document. Using this object, you may specify whether barcode values should be recognized. The barcode reading parameters are accessible via the BarcodeParams and DetectBarcodes properties of the PageAnalysisParams subobject. - Working with Layout and Blocks
You can also mark barcode blocks manually and specify their analysis and reading parameters. This section provides detailed information on working with blocks.
- BarcodeParams Object
- Working with the recognized barcode values
- BarcodeBlock Object
The Text and BarcodeText properties of this object contain the value of the barcode obtained through recognition. The other properties of this object can be used to get the type of the barcode, its orientation, and other parameters.
- BarcodeBlock Object
- Export
- Tuning Export Parameters
Setting up export with the objects of export parameters. - TextExportParams Object
This object allows you to set up the saving of recognition results to TXT.
- Tuning Export Parameters
