- Scanning
- Preprocessing of scanned images
Scenario implementation
Below follows a detailed description of the recommended method of using ABBYY FineReader Engine 12 in this scenario. Under the proposed implementation of the scenario, the image preparation phase is omitted. Please see Additional optimization below for tips on implementing image preparation.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#
Step 2. Scanning
Step 2. Scanning
ABBYY FineReader Engine offers a ScanManager object for managing the scanning sources. The ScanSources property of this object provides access to the list of all available scanners, while the FindScanSources method allows you to select the scanners by API type they provide and the user interface type you wish to use to set scanning options.To scan and save the files to disk, you can use either of these two methods of the ScanSource object: Scan method, which does not return until the scanning is complete, and BeginScan method, which starts the asynchronous scanning operation and returns immediately.You can implement the IScanCallback interface and use it to get notifications about the progress of scanning.The following parameters are accessible via the ABBYY FineReader Engine 12 API: brightness, color, resolution, image compression type, image rotation angle, the size of the scanning area, duplex scanning mode, automatic feeder mode, a pause between pages, and some more. The scanning parameters are set by using the ScanSettings property of the ScanSource object. This property is required to get access to the ScanSourceSettings object, which, in its turn, provides access to the scanning settings of a source.To scan the images synchronously:
- Create a ScanManager object. You can specify if the scanning logs are to be written by the input parameter of the CreateScanManager method.
- Select the scanning source using the FindScanSources method of the ScanManager object, specifying the API and UI type that should be supported by the scanner.
- If you choose to display no dialog box for the user to set scanning options him- or herself, tune the scanning options using the ScanSettings property of the chosen ScanSource. Select the appropriate values for brightness, resolution, and the other parameters in the corresponding properties of the ScanSourceSettings object. You can check which settings are available for this scanner using the Capabilities property of the ScanSource.
- Specify the folder name in which scanned pages will be stored. The folder name should be a BSTR variable, for example, ScanFolder.
- Run the Scan method of the ScanSource object, providing as the parameter the type of dialog box to be shown to the user (pass SSUIT_None constant to display no box), and the ScanFolder path to the folder with the results.
- The image file names will be returned by this method as a StringsCollection object. You can get the image file names from this StringsCollection object and then process the files as usual image files.
- Create an object implementing the IScanCallback interface. In the case of the asynchronous scanning operation, notifications from the callback interface are very useful.
- Create a ScanManager object. You can specify if the scanning logs are to be written by the input parameter of the CreateScanManager method.
- Select the scanning source using the FindScanSources method of the ScanManager object, specifying the API and UI type that should be supported by the scanner.
- If you choose to display no dialog box for the user to set scanning options him- or herself, tune the scanning options using the ScanSettings property of the chosen ScanSource. Select the appropriate values for brightness, resolution, and the other parameters in the corresponding properties of the ScanSourceSettings object. You can check which settings are available for this scanner using the Capabilities property of the ScanSource.
- Specify the folder name in which scanned pages will be stored. The folder name should be a BSTR variable, for example, ScanFolder.
- Run the BeginScan method of the ScanSource object, providing as the parameter the type of dialog box to be shown to the user (pass SSUIT_None constant to display no box), and the ScanFolder path to the folder with the results. You also need to pass the pointer to the callback object you created.
- The path to the image file is returned with OnImageScanned notification of the IScanCallback interface, and the completion of the operation is signaled by OnScanComplete notification. As you are providing the implementation for these methods, you can choose what to do in each of these situations. For example, on receiving the path to an image file you can work with it as with any other file from disk, loading it for processing with FineReader Engine in the usual way.
C#
Step 3. Unloading ABBYY FineReader Engine
Step 3. 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#
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 Opening.Scanning 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., 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:- Document separation
- In this scenario, you may need to group the incoming flow of images into documents. For example, you may know the number of pages in each document, or ensure there are separator pages with barcodes that come between the last page of the first document and the first page of the next document. Consult the barcode recognition scenario.
