CreateValidationReportA

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)

PDF/UA reader profile selection

PDF/UA checks select part 2 when XMP identifies pdfuaid:part=2 and otherwise retain the part 1 checks; legacy PDF/UA-1 checks described here are not implied to apply to part 2

The PDF/UA-2 profile implements core identification, namespace, role and structure checks; structured reports use PDF/UA-2 and ISO 14289-2 and disclose fullCertification=false and unverified scope

Use CheckFilePDFUACompliance or RunPDFUAValidationPipelineTask to force a target part and GetPDFUAReadValidationCoverageJSON to inspect capability limits

Description

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

Builds a structured PDF/A and PDF/UA-1 validation report in XML or JSON, with the ISO clause and statistics attached to every finding

Syntax

Delphi

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

DLL

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

Parameters

InputFileNameThe PDF file to validate
PasswordThe password required to open the file, or an empty string
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

Empty stringThe input file does not exist
ReportThe complete report document

Remarks

When multiple standards are selected, the file is parsed once and both audits share the same reader, security state, document object graph, and lazy object cache

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 emitted occurrences. 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

Incomplete checks

A check with only incomplete findings (00130 or 00132) returns result: incomplete; the overall summary is also incomplete unless another check fails, and incompleteChecks counts such checks separately from failedChecks and passedChecks

Findings 00130 and 00132 have warning severity and JSON incomplete: true; they identify an unsupported, unreadable or bounded-out signature or colour audit rather than a proven conformance failure

A failure takes precedence over incompleteness, which takes precedence over a pass; a standard that was not requested stays not-checked, and applications should accept only a passed summary for the selected checks

Legacy preflight text and prose-derived formats retain their finding-based failure summary; the raw structured validation report carries the explicit incomplete state

Example

// Uses System.JSON
Report:= PDF.CreateValidationReport('invoice.pdf', '', 3, 0, 1);
Root:= TJSONObject.ParseJSONValue(string(Report)) as TJSONObject;
try
  if Root = nil then
    raise Exception.Create('The validation report is not JSON');
  Verdict:= Root.GetValue<TJSONObject>('summary').GetValue<string>('result');
  if Verdict <> 'passed' then
    ShowMessage('The selected checks failed or could not be completed');
finally
  Root.Free;
end;

See also

CreateValidationPipelineReport, SaveValidationReport, CheckFileCompliance, CreatePreflightReport, CreatePreflightReportEx