PDFium Delphi Component Docs

ValidatePdfA method

Component: TPdf  ·  Unit: PDFium
Inspects the currently open PDF for PDF/A compliance markers and returns a structured result with the detected conformance level plus the set of specific issues found

Syntax

function ValidatePdfA: TPdfAValidationResult;

Description

ValidatePdfA walks the open document looking for every PDF/A conformance marker defined by ISO 19005-1 (with Cor.1:2007):

The result is a TPdfAValidationResult record:

ValidatePdfA is a read-only inspection — it does not modify the document and is safe to call repeatedly. Use it before handing a PDF to an archive system to surface non-compliance to the operator. For the common "what level is this?" check that does not need the issue list, prefer the lighter-weight PdfAConformance property

Remarks

Example

uses System.TypInfo;

var
  Outcome: TPdfAValidationResult;
  Issue: TPdfAValidationIssue;
begin
  Pdf1.FileName := 'C:\Incoming\report.pdf';
  Pdf1.Active := True;
  Outcome := Pdf1.ValidatePdfA;
  Memo1.Lines.Add('Level: ' + GetEnumName(TypeInfo(TPdfAConformance),
    Ord(Outcome.Conformance)));
  for Issue in Outcome.Issues do
    Memo1.Lines.Add('- ' + GetEnumName(TypeInfo(TPdfAValidationIssue), Ord(Issue)));
end;

See Also

PdfAConformance, InspectPdfAMetadata, NormalizePdfAMetadata, SaveAsPdfA, SaveAsPdfAToStream

Integer implementation-limit checks read lexical PDF tokens, leaving out comments, literal and hexadecimal strings, names and real numbers; signed 32-bit boundaries and leading zeros are handled with no integer overflow

Since v3.256.0, PDF/A-4 checks the required pdfaid:rev=2020, strict present conformance values, required 4f EmbeddedFiles names and bounded name-tree ownership, the Info/PieceInfo relationship and the sole permitted Info ModDate entry. PDF/A-4e uses engineering rules and has no Level A structure gate or downgrade

Base PDF/A-4 embedded files are checked recursively against the selected PDF/A-1/2/4 rules, with limits of four attachment levels, 32 distinct checked streams, 16 MiB decoded bytes per stream and 64 MiB aggregate decoded payload. Unsupported or exhausted inspection remains observable through pvaiEmbeddedPdfAUnchecked; malformed ownership uses pvaiEmbeddedFileGraphInvalid

A Form XObject or Type 3 font that omits /Resources inherits the resource dictionary of the active page, including one inherited from a page-tree ancestor (ISO 32000-1 Table 95 and 7.8.3). Its marked-content /AF scopes are resolved against that dictionary, so an associated file is classified as associated or unassociated instead of leaving the candidate unchecked. pvaiEmbeddedPdfAUnchecked remains for content that cannot be decoded, an unreadable active revision and exhausted traversal budgets. The page resource dictionary is resolved before /Annots is walked, so an annotation appearance stream without /Resources uses that same context. A tiling pattern without /Resources keeps the fail-closed policy because Table 75 requires that entry

New issues preserve existing enum ordinals: pvaiPdfA4RevisionInvalid, pvaiPdfAIdentifierInvalid, pvaiPdfA4EmbeddedFilesMissing, pvaiPdfA4InfoWithoutPieceInfo, pvaiPdfA4InfoInvalid, pvaiEmbeddedPdfANonConforming, pvaiEmbeddedPdfAUnchecked, pvaiEmbeddedFileGraphInvalid and pvaiPdfA4Engineering3DInvalid

Selected built-in checks and a detected marker do not establish full PDF/A conformity, child-document certification or valid 3D model content; independent profile validation and domain review remain required