SaveValidationReportA

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

The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to SaveValidationReport and string arguments are interpreted using the current SetAnsiMode code page

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

Syntax

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);

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