Metoda THotPDF.ComplianceFindingsToJSON

Serializes shared validation and repair findings into deterministic JSON for CI, audit storage, and external compliance tooling

Declaration

function ComplianceFindingsToJSON(
  const Findings: THPDFComplianceFindings): AnsiString;

Unit

HPDFDoc

Finding model

THPDFComplianceFinding contains the following fields

FieldPurpose
ProfileIdentifies cpfPDFUA2, cpfPDFA4, or cpfPDFX6
SeverityIdentifies informational, warning, or error findings through THPDFComplianceSeverity
RuleIDProvides the stable namespaced rule identifier
ClauseProvides the applicable standard and clause reference
PathProvides the logical object-graph location
ObjectNumberProvides the indirect object number or a negative value when unknown
PageIndexProvides the zero-based page index or a negative value when unknown
MessageProvides a human-readable diagnostic
RepairStatusIdentifies not attempted, applied, unresolved, rolled back, or failed repair provenance through THPDFComplianceRepairStatus
RepairActionNames the repair family when repair was attempted
RepairCountCounts applied operations represented by the finding

JSON contract

The root schema identifier is hotpdf.compliance.findings.v1, findings retain deterministic input order, and every object uses a stable field order

Unknown object and page locations are serialized as JSON null, while the first page remains the numeric value 0

Strings are JSON escaped, control characters use standard escapes, and an empty finding array produces a valid document with an empty findings array

Example

var
  Options: THPDFPDFA4ValidationOptions;
  Findings: THPDFComplianceFindings;
  JSON: AnsiString;
begin
  Options := THPDFPDFA4ValidationOptions.Default;
  PDF.ValidatePDFA4(Options, Findings);
  JSON := PDF.ComplianceFindingsToJSON(Findings);
end;

Related APIs