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

HRESULT RecognizeImageFile(
  BSTR                         ImageFileName,
  IPrepareImageMode            PrepareMode,
  IDocumentProcessingParams*   DocumentProcessingParams,
  FileExportFormatEnum         ExportFormat,
  IUnknown*                    ExportParams,
  IImagePasswordCallback*      PasswordCallback,
  BSTR                         OutputFileName
);
    

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.

See also

Engine

IImagePasswordCallback

Working with Profiles

7/3/2024 8:50:10 AM

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.