CreateValidationReport
Compliance
Descrição
Constrói um relatório estruturado de validação PDF/A e PDF/UA-1 em XML ou JSON, com a cláusula ISO e estatísticas anexadas a cada constatação
Sintaxe
Delphi
Function TPDFlib.CreateValidationReport(Const InputFileName, Password: WideString; ComplianceTests, Options, ReportFormat: Integer): WideString;Parâmetros
| InputFileName | The PDF file to validate. |
|---|---|
| Password | The password required to open the file, or an empty string. |
| ComplianceTests | Bit mask selecting the checks: 1 = PDF/A, 2 = PDF/UA-1, 0 = both. |
| Options | Passed through to the checks; 1 stops at the first finding of each check. |
| ReportFormat | 0 = XML, 1 = JSON. |
Return values
| Empty string | The input file does not exist. |
|---|---|
| Report | The complete report document. |
Remarks
Quando vários padrões são selecionados, o arquivo é analisado uma única vez e ambas as auditorias compartilham o mesmo leitor, estado de segurança, grafo de objetos do documento e cache de objetos lazy
Each finding carries the rule id, the standard that owns the rule (ISO 19005-1 or ISO 14289-1), a short machine-readable rule name, the ISO clause the rule enforces, a severity and the number of affected objects. Every check element closes with its own result and issue count, and the report ends with a summary carrying the document verdict, the total issue count and the number of passed and failed checks.
A standard that was not requested is reported as not-checked rather than as a passing check, so a run that covered only one standard cannot be mistaken for a clean bill of health.
This differs from CreatePreflightReportEx, which renders a human report first and then converts that prose into JSON, HTML or CSV. The validation report is assembled from the raw check output, so a build pipeline can gate on a rule id or an ISO clause instead of matching substrings in a sentence.
Exemplo
Report:= PDF.CreateValidationReport('invoice.pdf', '', 0, 0, 1);
if Pos('"result": "failed"', Report)> 0 then
ShowMessage('the file did not pass validation');See also
CreateValidationPipelineReport, SaveValidationReport, CheckFileCompliance, CreatePreflightReport, CreatePreflightReportEx