Chinese Simplified (简体中文)

在 C (Objective-C) 中使用 ABBYY FineReader Engine

本节内容说明如何在 C (Objective-C) 中下载和卸载 ABBYY FineReader Engine。

  1. 导入 FREngine.h 标头文件时包括该代码:
/* C */
#define __RPC__deref_out
#include <FREngine.h>
/* Objective-C */
#define interface _COM_interface
#define __RPC__deref_out
#import <FREngine.h>
#undef interface
  1. 使用以下代码下载和卸载 FREngine.dll:
typedef HRESULT (*initializeEngine_ptr) (BSTR, BSTR, BSTR, BSTR, BSTR, VARIANT_BOOL, IEngine **);
typedef HRESULT (*DeinitializeEngine_ptr) (void);
static IEngine* FREngine;
static HMODULE FREngineDll;
int main(int argc, char *argv[]) {
 initializeEngine InitializeEngine=NULL;
 DeinitializeEngine_ptr DeinitializeEngine=NULL;
// 在此提供您的客户项目 ID 和在线许可证(如有)信息
wchar_t *customerProjectId = L"";
wchar_t *licensePath = L"";
wchar_t *licensePassword = L"";
 FREngineDll = LoadLibraryEx("<FREngine.dll 的路径>", 0, LOAD_WITH_ALTERED_SEARCH_PATH);
 if(FREngineDll) {
  InitializeEngine = (InitializeEngine_ptr) GetProcAddress(FREngineDll,"InitializeEngine");
   InitializeEngine(customerProjectId, licensePath, licensePassword, "", "", FALSE, &FREngine);
 IEngine_Release( FREngine );
 DeinitializeEngine = (DeinitializeEngine_ptr) GetProcAddress(FREngineDll,"DeinitializeEngine");
  1. 对 ABBYY FineReader Engine 的所有其它调用都可以使用在 FREngine.h 标头文件中定义的 C 宏指令。
void ProcessImage()
 IFRDocument* frDocument = NULL;
 IEngine_CreateFRDocument( FREngine, &frDocument );
 IFRDocument_AddImageFile( frDocument, L"<源图像的路径>", NULL, NULL );
 IFRDocument_Process( frDocument, NULL, NULL, NULL );
 IFRDocument_Export( frDocument, L"<输出文件的路径>", FEF_PDF, NULL );
 IFRDocument_Release( frDocument );



03.07.2024 8:50:44

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.