CheckCompliancePDFA

Compliance, Document inspection

Requires the Enterprise edition — the unit belongs to the Enterprise edition; the library-level wrapper CheckFileCompliance keeps the entry point in every edition, where non-Enterprise builds return 0 and set LastErrorCode to 900 (PDFLIB_ERROR_ENTERPRISE_REQUIRED)

Description

Reads an arbitrary PDF stream and audits it against ISO 19005, the PDF/A standard. The applicable part and conformance level come from the document's XMP pdfaid:part and pdfaid:conformance entries; metadata that does not parse as XML identifies no part and is reported like a missing claim.

Every failed rule appends one string to ResultList: a five-digit code, a space and a human-readable message, in the 00xxx range also used by CheckFileCompliance. The audit covers document-level rules per part, including the PDF version ceiling, forbidden optional content, encryption, output intent, tagging at level A, fonts, colour usage, transparency, embedded files and interactive form structure.

A score of 100 means the implemented checks found no issue; it is a self-check, not a certification. GetPDFAReadValidationCoverageJSON names the checked and unverified regions per part so a conformance statement can be published honestly.

Syntax

Delphi

Function CheckCompliancePDFA(InputStream: TStream; Const Password: WideString;
  Options: Integer; ResultList: TStringList): Integer;

Parameters

InputStreamThe PDF bytes to audit; the stream is read, not written or closed
PasswordPassword used to open the document; an empty string suits unencrypted files. A wrong password on an encrypted document is reported as issue 00006, and an encrypted document fails PDF/A regardless of a correct password
Options0 reports every issue found; 1 stops the audit at the first failed rule, which suits a pass or fail gate
ResultListReceives one string per finding, appended after any existing content; pass nil to let the function collect findings into an internal list

Return values

100The implemented PDF/A checks appended no issue to ResultList
0At least one issue was appended; enumerate ResultList for the codes and messages, including 00000 when the stream is not a valid PDF

Remarks

Issue codes and their meanings are listed on the CheckFileCompliance page, which forwards its PDF/A test to this audit.

This Pascal unit function has no separate DLL or ActiveX forwarding entry point.

See also

CheckFileCompliance, GetPDFAReadValidationCoverageJSON, CheckFilePDFUACompliance, SetPDFAMode, CreatePreflightReport