- Preprocessing of scanned images or photos
- Recognition with full restoration of document structure and formatting
- Export to an editable format
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
ABBYY FineReader Engine enables loading of all processing settings that are most suitable for this scenario using the LoadPredefinedProfile method of the Engine object. This method receives the profile name as an input parameter. Please see Working with Profiles for more information.ABBYY FineReader Engine supports 2 variants of settings for this scenario:
If you wish to change processing settings, use appropriate parameter objects. Please see Additional optimization for specific tasks below for further information.
Profile name | Description |
|---|---|
DocumentConversion_Accuracy | The settings have been optimized for accuracy:
|
DocumentConversion_Normal | The settings have been optimized for processing speed:
|
C#
C++ (COM)
Step 3. Loading and preprocessing the images
Step 3. Loading and preprocessing the images
ABBYY FineReader Engine provides the FRDocument object which allows processing multi-page documents. Using of this object allows you to preserve the logical organization of the document, retaining the original text and columns, fonts, styles, etc.To load images of a single document and preprocess them, you should create the FRDocument object and add images to it. You may do one of the following:
- Create the FRDocument object using the CreateFRDocumentFromImage method of the Engine object. This method creates the FRDocument object and loads images from the specified file.
- Create the FRDocument object with the help of the CreateFRDocument method of the Engine object, then add images to the created FRDocument object from file (use the AddImageFile, AddImageFileWithPassword, or AddImageFileWithPasswordCallback method of the FRDocument object).
C#
C++ (COM)
Image preprocessing with the loaded DocumentConversion_Normal profile does not include orientation detection. If you want the image orientation to be automatically detected, you will need to set up additional parameters and pass the corresponding object to the preprocessing function. Please refer to Additional optimization for specific tasks below for further information.
Step 4. Document recognition
Step 4. Document recognition
To recognize a document, we suggest that you use the analysis and recognition methods of the FRDocument object. This object provides a whole array of methods for document analysis, recognition, and synthesis. The most convenient method which provides document analysis, recognition, and synthesis all-in-one is the Process method. It also uses simultaneous processing features of multiprocessor and multicore systems in the most efficient manner. However, you can also perform consecutive preprocessing, analysis, recognition, and synthesis using Preprocess, Analyze, Recognize, and Synthesize methods.
C#
C++ (COM)
Step 5. Document export
Step 5. Document export
To save a recognized document, you can use the Export method of the FRDocument object by assigning the FileExportFormatEnum constant as one of the parameters. You can 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 for specific tasks
Below is the overview of the Help topics containing additional information regarding customization of settings at different stages of the document conversion to an editable format:- Scanning - Windows Only
- Scanning
Description of the ABBYY FineReader Engine scenario for document scanning.
- Scanning
- Recognition
- Tuning Parameters of Preprocessing, Analysis, Recognition, and Synthesis
Customization of document processing using objects of analysis, recognition and synthesis parameters. - Recognize handwriting
The DocumentConversion_*** profiles do not include handwritten or handprinted text recognition. If you need to recognize handwriting, set the DetectHandwritten property of the PageAnalysisParams object to TRUE. - PageProcessingParams Object
This object enables the customization of analysis and recognition parameters. Using this object, you can indicate which image and text characteristics must be detected (inverted image, orientation, barcodes, recognition language, recognition error margin). - SynthesisParamsForPage Object
This object includes parameters responsible for restoration of a page formatting during synthesis. - SynthesisParamsForDocument Object
This object enables customization of the document synthesis: restoration of its structure and formatting. - MultiProcessingParams Object - Implemented for Linux and Windows
Simultaneous processing may be useful when processing a large number of images. In this case, the processing load will be spread over the processor cores during image opening and preprocessing, layout analysis, recognition, and export, which makes it possible to speed up processing.
Reading modes (simultaneous or consecutive) are set using the MultiProcessingMode property. The RecognitionProcessesCount property controls the number of processes that may be started.
- Tuning Parameters of Preprocessing, Analysis, Recognition, and Synthesis
- Export
- Tuning Export Parameters
Customization of the document export using objects of export parameters. - RTFExportParams Object
This object enables customization of the RTF/DOCX/ODT saving format parameters. - HTMLExportParams Object
This object allows customization of export to the HTML format. - PPTExportParams Object
Object for customization of the PPTX saving format parameters.
- Tuning Export Parameters
