function ValidatePdfVT: TPdfVTValidationResult;
ValidatePdfVT walks the open document looking for the file-format-level markers defined by ISO 16612-2:2010:
pdfvtid:GTS_PDFVTVersion (§6.3 Table 2) and pdfvtid:GTS_PDFVTModDate.pdfvtid:GTS_PDFVTModDate and xmp:ModifyDate (§6.3 NOTE 1).pdfxid:GTS_PDFXVersion — PDF/VT-1 must be PDF/X-4 (§6.2.1), while PDF/VT-2 must use one of the file-set bases PDF/X-4p, PDF/X-5g, or PDF/X-5pg (§6.2.2).pdfaExtension:schemas description for both pdfvtid and pdfxid namespaces./DPartRoot entry with a usable §6.5 DPart tree: the /DPartRootNode, XML NMTOKEN-compatible /NodeNameList, parent links, /DParts array-of-arrays, leaf /Start//End ranges, and per-page /DPart references must cover the page tree exactly once in depth-first order./OutputIntents array with an OutputIntent that has /DestOutputProfile (inherited PDF/X-4 requirement)./ID array and the absence of /Encrypt (PDF/X forbids encryption).xmp:CreateDate and xmp:ModifyDate entries in XMP for Info / XMP parity.The result is a TPdfVTValidationResult record:
pvc1 (PDF/VT-1 marker), pvc2 (PDF/VT-2 marker), pvcNone (no PDF/VT marker), or pvcUnknown (marker present but file-level version unrecognized).TPdfVTValidationIssues set with zero or more values: pvviMissingXmpMetadata, pvviMissingPdfVTIdentifier, pvviMissingExtensionSchema, pvviMissingPdfVTModDate, pvviModDateMismatch, pvviMissingDPartRoot, pvviMissingPdfXIdentifier, pvviMissingOutputIntent, pvviMissingIccProfile, pvviMissingTrailerId, pvviEncryptionPresent, pvviMissingXmpDates.Conformance is a real PDF/VT level and Issues is emptyValidatePdfVT is read-only. It checks the file-format markers,
selected DPart tree semantics, exact PDF/VT-to-PDF/X base pairing, and XMP
properties whether they are written as elements or RDF attributes. Pair
it with a PDF/X preflight engine for full content-level verification and,
for PDF/VT-2, a complete file-set validator. PDF/VT-2s is a MIME stream
conformance level whose version is signalled by the MIME stream header in
ISO 16612-2 Annex A, not by a file-level pdfvtid:GTS_PDFVTVersion
value.
pvviMissingDPartRoot is emitted when the catalog lacks a usable /DPartRoot hierarchy or when the tree violates §6.5 requirements such as malformed /DParts arrays, mixed /Start and /DParts, duplicated child ownership, invalid /NodeNameList names or depth mismatches, page ranges that do not follow the page tree order, single-page ranges that repeat /Start as /End, or page /DPart links that do not point to the covering leaf DPart.pvviModDateMismatch is emitted only when both pdfvtid:GTS_PDFVTModDate and xmp:ModifyDate are present and their values differ. SaveAsPdfVT always writes them with the same value.Conformance = pvcUnknown and an empty Issues set.
uses System.TypInfo;
var
Outcome: TPdfVTValidationResult;
Issue: TPdfVTValidationIssue;
begin
Pdf1.FileName := 'C:\Incoming\statements.pdf';
Pdf1.Active := True;
Outcome := Pdf1.ValidatePdfVT;
Memo1.Lines.Add('Level: ' + GetEnumName(TypeInfo(TPdfVTConformance),
Ord(Outcome.Conformance)));
for Issue in Outcome.Issues do
Memo1.Lines.Add('- ' + GetEnumName(TypeInfo(TPdfVTValidationIssue), Ord(Issue)));
end;