PDFiumVCL 文档

ValidatePdfX method

此 API 条目保留标识符、签名、代码块和 PDF 术语的原始形式。
Component: TPdf  ·  Unit: PDFium
Inspects the currently open PDF for PDF/X compliance markers and returns a structured result with the detected conformance level plus the set of specific issues found.

Syntax

function ValidatePdfX: TPdfXValidationResult;

Description

ValidatePdfX walks the open document looking for the file-format markers defined by the ISO 15930 family:

The result is a TPdfXValidationResult record:

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.

Remarks

Example

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;

See Also

PdfXConformance, SaveAsPdfX, SaveAsPdfXToStream, ValidatePdfA, ValidatePdfE, ValidatePdfUa