CreateTextComparisonReportA
Small Business、比较报告
需要 Small Business 版。在 Delphi、C++Builder 和 Lazarus 代码中,请将库创建为 TPDFlibSmallBusiness(单元 PDFlibSmallBusiness)或 TPDFlibEnterprise;Small Business 版和 Enterprise 版的 DLL 与 ActiveX 构建原样提供该方法。Single 版保留此方法,它返回空字符串,并将 LastErrorCode 设置为 901 (PDFLIB_ERROR_SMALLBUSINESS_REQUIRED)
需要 Small Business 或 Enterprise 版;普通 TPDFlib 返回空字符串和错误 901
描述
末尾的 A 表示 ANSI(char)DLL 入口点;ActiveX/COM 面只暴露 Unicode 形式。行为与 CreateTextComparisonReport 相同,字符串参数按当前 SetAnsiMode 代码页解释
语法
Delphi
Function DLCreateTextComparisonReportA(InstanceID: Integer; OtherFileName: PAnsiChar; Password: PAnsiChar; Granularity: Integer; ReportFormat: Integer): PAnsiChar;
DLL
const char* DLCreateTextComparisonReportA(int InstanceID, const char* OtherFileName, const char* Password, int Granularity, int ReportFormat);
将选定文档与单独加载的基线文件比较,不替换选定文档;Granularity 为 0 表示词、1 表示行,ReportFormat 为 0 表示 HTML、1 表示 JSON
HTML 报告把转义后的基线文本与当前文本并列展示;它不会执行文档文本中出现的标记
JSON 信封包含 schemaVersion:1、status、comparisonKind:"extracted-text"、complete 以及底层的 comparison 对象
不完整的比较在两种格式中均保持可见;这些报告比较的是提取出的文本,不比较页面外观、图像内容或版式
操作错误返回错误报告并设置错误 905;有效的比较报告即使包含差异或不完整比较,也设置错误 0
Report:= PDF.CreateTextComparisonReport('baseline.pdf', '', 0, 0);
DLL 与 Dylib 提供 DLCreateTextComparisonReport 及其 A 变体;ActiveX 使用 IPDFlibrary8 或 CoPDFlibrary.CreateEditionTools8
SaveTextComparisonPDF · CompareTextBaselineBatch · CompareDocumentTextsWith