ApplyOCRTextLayerA
OCR、文本、文档编辑
描述
ApplyOCRTextLayer 的 ANSI 变体
字符串参数按 ANSI 文本接受,其余行为与宽字符串入口点完全相同
语法
Delphi
Function TPDFlib.ApplyOCRTextLayer(Page: Integer; Const ResultJSON,
FontName: WideString; MinConfidence: Double): Integer;ActiveX
Function PDFlib::ApplyOCRTextLayer(Page As Long, ResultJSON As String, FontName As String, MinConfidence As Double) As LongDLL
int DLApplyOCRTextLayer(int InstanceID, int Page, const wchar_t* ResultJSON,
const wchar_t* FontName, double MinConfidence);
int DLApplyOCRTextLayerA(int InstanceID, int Page, const char* ResultJSON,
const char* FontName, double MinConfidence);返回值
| 1 | 文本层已添加,或者没有单词达到阈值 |
|---|---|
| 0 | 验证或写入失败 |
备注
在写入页面内容前,将验证完整的 JSON 结构和每个词边界
每个词根据其框高度确定大小,并使用文本缩放进行水平适配;独立图形状态可防止 OCR 格式泄漏到后续绘图操作
OCR JSON 无效时 LastErrorCode 为 110,页面、字体或文本层写入失败时为 307
LastOCRError 提供详细原因