SaveValidationReport

Compliance

Description

Writes the structured validation report of a file to disk as UTF-8.

Syntax

Delphi

Function TPDFlib.SaveValidationReport(Const InputFileName, Password, ReportFileName: WideString; ComplianceTests, Options, ReportFormat: Integer): Integer;

Parameters

InputFileNameThe PDF file to validate.
PasswordThe password required to open the file, or an empty string.
ReportFileNameThe report file to write; missing directories are created.
ComplianceTestsBit mask selecting the checks: 1 = PDF/A, 2 = PDF/UA-1, 0 = both.
OptionsPassed through to the checks; 1 stops at the first finding of each check.
ReportFormat0 = XML, 1 = JSON.

Return values

1The report was written.
0No report file name was given, or the input file does not exist.

Remarks

The report content is identical to CreateValidationReport; only the delivery differs. Writing the report next to the artefact it describes keeps a build log auditable without holding the document in memory.

Example

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

See also

CreateValidationReport, SavePreflightReport, SavePreflightReportEx