SaveValidationReport
Compliance
Requires the Enterprise edition — in Delphi, C++Builder and Lazarus code create the library as TPDFlibEnterprise (unit PDFlibEnterprise); the Enterprise DLL and ActiveX builds provide it unchanged; other editions keep the method, which returns 0, an empty string or False and sets LastErrorCode to 900 (PDFLIB_ERROR_ENTERPRISE_REQUIRED)
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; Virtual;ActiveX
Function PDFlib::SaveValidationReport(InputFileName As String, Password As String, ReportFileName As String, ComplianceTests As Long, Options As Long, ReportFormat As Long) As LongDLL
int DLSaveValidationReport(int InstanceID, const wchar_t* InputFileName, const wchar_t* Password, const wchar_t* ReportFileName, int ComplianceTests, int Options, int ReportFormat);
int DLSaveValidationReportA(int InstanceID, const char* InputFileName, const char* Password, const char* ReportFileName, int ComplianceTests, int Options, int ReportFormat);Parameters
| InputFileName | The PDF file to validate |
|---|---|
| Password | The password required to open the file, or an empty string |
| ReportFileName | The report file to write; missing directories are created |
| 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
| 1 | The report was written |
|---|---|
| 0 | No 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