RecognizeImageFile Method of the Engine Object
This method opens the image file specified, performs its preprocessing, layout analysis, recognition, page and document synthesis, and exports the recognized text into the selected output format. The RecognizeImageFile method can process multi-page images and export the recognition results to a single file.
Syntax
C++
HRESULT RecognizeImageFile( BSTR ImageFileName, IPrepareImageMode PrepareMode, IDocumentProcessingParams* DocumentProcessingParams, FileExportFormatEnum ExportFormat, IUnknown* ExportParams, IImagePasswordCallback* PasswordCallback, BSTR OutputFileName );
C#
void RecognizeImageFile( string ImageFileName, IPrepareImageMode PrepareMode, IDocumentProcessingParams DocumentProcessingParams, FileExportFormatEnum ExportFormat, object ExportParams, IImagePasswordCallback PasswordCallback, string OutputFileName );
Visual Basic .NET
Sub RecognizeImageFile( _ ImageFileName As String, _ PrepareMode As IPrepareImageMode, _ DocumentProcessingParams As IDocumentProcessingParams, _ ExportFormat As IFileExportFormatEnum, _ ExportParams As Object, _ PasswordCallback As IImagePasswordCallback, _ OutputFileName As String _ )
Parameters
- ImageFileName
- [in] Contains the full path to an image file that is to be recognized. If this file is not in ABBYY FineReader Engine internal format, it is prepared using the default values of the PrepareImageMode properties, or, if a profile has been loaded, the parameters set by this profile are used.
- PrepareMode
- [in] This variable refers to the PrepareImageMode object that stores parameters for image conversion in internal format. This parameter may be 0 in which case default parameters of the image preparation mode are used, or, if a profile has been loaded, the parameters set by this profile are used.
- DocumentProcessingParams
- [in] Refers to the DocumentProcessingParams object that stores all processing parameters. This parameter may be 0. In this case, the document is processed using the default parameters (all processing parameters are set to default values, and the recognition language is English), or, if a profile has been loaded, the parameters set by this profile are used.
- ExportFormat
- [in] This variable of the FileExportFormatEnum type specifies the format of the output file into which the recognized text is exported.
- ExportParams
- [in] Pass the export parameters object of type corresponding to your file format through this input parameter. For example, if you are creating an RTF file, create the RTFExportParams object, set necessary parameters in it, and pass to this method as the exporterParams input parameter. This parameter is optional and may be 0, in which case the parameters of export have default values, or, if a profile has been loaded, the parameters set by this profile are used.
- PasswordCallback
- [in] Refers to the interface of the user-implemented object of the type ImagePasswordCallback which is used to handle possible password requests for accessing images in PDF format. This parameter is optional and may be 0 in which case password-protected files cannot be processed.
- OutputFileName
- [in] Contains the full path to the output file where the recognized text should be exported. If a file at this location already exists, it is overwritten without prompt, or recognized text is append to its end, depending on the mode of export.
Return values
If recognition is interrupted by the user, this method will return E_ABORT. If pattern training is interrupted by the user, this method will return FREN_E_PATTERN_TRAINING_ABORTED. It also returns the standard return codes of ABBYY FineReader Engine functions.
Remarks
Depending on the value of the IEngine::MultiProcessingParams property, ABBYY FineReader Engine can distribute processing of multi-page documents to CPU cores.
See also
17.09.2024 15:14:41