function ValidatePdfX: TPdfXValidationResult;
ValidatePdfX は開いている文書を走査し、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_PDFXVersionXMP プロパティと同じ値であることを確認します/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 および xmp:ModifyDate エントリ。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 は読み取り専用の検査です。PDF/X ペイロードをプリプレスワークフローへ投入する前に使用し、非準拠をオペレーターへ提示します。問題リストが不要な一般的な「これはどの PDF/X レベルか」の確認には、より軽量なPdfXConformance property.
pvxiInfoVersionMismatchInfo /GTS_PDFXVersion と XMP pdfxid:GTS_PDFXVersion の両方が存在し、値が一致しない場合にだけ報告されます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;