IHPDFOCREngine Interface
对 OCR provider 做了抽象,而页面渲染、校验、PDF 几何、Unicode 映射、资源限制和事务式发布均由 HotPDF 负责
声明
IHPDFOCREngine = interface(IInterface)
function GetName: AnsiString;
function Recognize(const Request: THPDFOCRRequest;
out Words: THPDFOCRWords;
out Diagnostic: AnsiString): boolean;
property Name: AnsiString read GetName;
end;
Contract
产出零个或多个单词后,Recognize 返回 True;识别无法完成时,返回 False 并附带诊断信息
位图和取消令牌仅在调用期间借用,实现必须遵守 MaxWords 和 MaxTextCodeUnits
实现可以只报告不带基线的单词框,此时 HotPDF 会在框底部附近推断一条水平基线