function ValidatePdfX: TPdfXValidationResult;
ValidatePdfX walks the open document looking for the file-format markers defined by the ISO 15930 family:
pdfxid:GTS_PDFXVersion (and optionally pdfxid:GTS_PDFXConformance for PDF/X-1a / PDF/X-3).pdfaExtension:schemas description for the pdfxid namespace (XMP extension-schema convention)./GTS_PDFXVersion with the same value as the XMP property./OutputIntents array referencing an OutputIntent dictionary with an embedded ICC profile via /DestOutputProfile./Title entry (PDF/X strongly recommends it)./ID array and the absence of /Encrypt (encryption is forbidden by all PDF/X versions).xmp:CreateDate and xmp:ModifyDate entries in XMP for Info / XMP parity.The result is a TPdfXValidationResult record:
pxc1a (matches "PDF/X-1"), pxc3 ("PDF/X-3"), pxc4 ("PDF/X-4"), pxcNone (no PDF/X marker), or pxcUnknown (marker present but unrecognised).TPdfXValidationIssues set with zero or more of: pvxiMissingXmpMetadata, pvxiMissingPdfXIdentifier, pvxiMissingExtensionSchema, pvxiMissingInfoVersionEntry, pvxiInfoVersionMismatch, pvxiMissingOutputIntent, pvxiMissingIccProfile, pvxiMissingTitle, pvxiMissingTrailerId, pvxiEncryptionPresent, pvxiMissingXmpDates.ValidatePdfX is a read-only inspection. Use it before pushing a
PDF/X payload into a prepress workflow to surface non-conformance
to the operator. For the common "what PDF/X level is this?" check
that doesn't need the issue list, prefer the lighter-weight
PdfXConformance property.
pvxiInfoVersionMismatch only when both Info /GTS_PDFXVersion and XMP pdfxid:GTS_PDFXVersion are present and disagree.Conformance = pxcUnknown and an empty Issues set.pxcUnknown.
uses System.TypInfo;
var
Outcome: TPdfXValidationResult;
Issue: TPdfXValidationIssue;
begin
Pdf1.FileName := 'C:\Incoming\ad.pdf';
Pdf1.Active := True;
Outcome := Pdf1.ValidatePdfX;
Memo1.Lines.Add('Level: ' + GetEnumName(TypeInfo(TPdfXConformance),
Ord(Outcome.Conformance)));
for Issue in Outcome.Issues do
Memo1.Lines.Add('- ' + GetEnumName(TypeInfo(TPdfXValidationIssue), Ord(Issue)));
end;