跳转到主要内容
此方法在 Windows 版 FRE 中实现。
此方法以一组数组的形式返回文本中所有字符的信息:字符所在的页码、字符 Rectangle 的坐标以及字符的置信度。 然后,您可以在本地遍历这些数据,从而避免执行可能非常耗时的文本 Block 和 Paragraph 遍历过程。
在 Windows 中,如果您的应用程序通过 DCOM 运行,则尤其建议这样做。

语法

C++

HRESULT GetCharacterData(
  SAFEARRAY** PageNumbers,
  SAFEARRAY** LeftBorders,
  SAFEARRAY** TopBorders,
  SAFEARRAY** RightBorders,
  SAFEARRAY** BottomBorders,
  SAFEARRAY** Confidences,
  SAFEARRAY** IsSuspicious
);

C#

void GetCharacterData(
  out int[]  PageNumbers,
  out int[]  LeftBorders,
  out int[]  TopBorders,
  out int[]  RightBorders,
  out int[]  BottomBorders,
  out int[]  Confidences,
  out bool[] IsSuspicious
);

Visual Basic .NET

Sub GetCharacterData( _
  ByRef PageNumbers() As Integer, _
  ByRef LeftBorders() As Integer, _
  ByRef TopBorders() As Integer, _
  ByRef RightBorders() As Integer, _
  ByRef BottomBorders() As Integer, _
  ByRef Confidences() As Integer, _
  ByRef IsSuspicious() As Boolean _
)

参数

PageNumbers [out] 字符所在页面的页码数组。 LeftBorders [out] 字符 Rectangle 左边界坐标数组,坐标相对于源图像经纠偏后的黑白平面。 TopBorders [out] 字符 Rectangle 上边界坐标数组,坐标相对于源图像经纠偏后的黑白平面。 RightBorders [out] 字符 Rectangle 右边界坐标数组,坐标相对于源图像经纠偏后的黑白平面。 BottomBorders [out] 字符 Rectangle 下边界坐标数组,坐标相对于源图像经纠偏后的黑白平面。 Confidences [out] 字符置信度数组。 IsSuspicious [out] 布尔值数组,用于指示这些字符的识别结果是否可疑。

返回值

此方法没有特定的返回值。它返回 ABBYY FineReader Engine 函数的标准返回值

备注

您无需在调用该方法之前手动创建数组;这些数组会由该方法在内部创建。但当这些数组不再使用时,您需要负责调用 SafeArrayDestroy 方法将其销毁。

另请参阅

PlainText