SaveValidationReportA

合规

需要 Enterprise 版。在 Delphi、C++Builder 和 Lazarus 代码中,请将库创建为 TPDFlibEnterprise(单元 PDFlibEnterprise);Enterprise 版的 DLL 和 ActiveX 构建原样提供该类。其他版本保留此方法,它返回 0、空字符串或 False,并将 LastErrorCode 设置为 900 (PDFLIB_ERROR_ENTERPRISE_REQUIRED)

描述

末尾的 A 表示 ANSI(char)DLL 入口点;ActiveX/COM 接口仅公开 Unicode 形式。其行为与 SaveValidationReport 相同,字符串参数按当前 SetAnsiMode 代码页解释

将文件的结构化验证报告以 UTF-8 格式写入磁盘

语法

Delphi

Function DLSaveValidationReportA(InstanceID: Integer; InputFileName: PAnsiChar; Password: PAnsiChar; ReportFileName: PAnsiChar; ComplianceTests: Integer; Options: Integer; ReportFormat: Integer): Integer;

DLL

int DLSaveValidationReportA(int InstanceID, const char* InputFileName, const char* Password, const char* ReportFileName, int ComplianceTests, int Options, int ReportFormat);

参数

InputFileName要验证的 PDF 文件
Password打开文件所需的密码,或空字符串
ReportFileName要写入的报告文件,缺失的目录会被创建
ComplianceTests选择检查项的位掩码:1 = PDF/A,2 = PDF/UA-1,0 = 两者
Options传递给检查;1 会在每项检查的第一个发现处停止
ReportFormat0 = XML,1 = JSON

返回值

1报告已写入
0未提供报告文件名,或输入文件不存在

备注

报告内容与 CreateValidationReport 相同;仅交付方式不同。将报告写在其描述的工件旁,无需将文档保留在内存中即可使构建日志保持可审计

示例

if PDF.SaveValidationReport('invoice.pdf', '', 'reports\invoice.xml', 0, 0, 0)= 0 then
  ShowMessage('the report could not be written');

另请参阅

CreateValidationReport、SavePreflightReport、SavePreflightReportEx