PDFium Component Docs

Phương thức ValidatePdfUa

Component: TPdf  ·  Unit: PDFium
Kiểm tra PDF đang mở để tìm các dấu hiệu tuân thủ và trả về kết quả có cấu trúc với mức tuân thủ đã phát hiện cùng tập các vấn đề cụ thể được tìm thấy

Syntax

function ValidatePdfUa: TPdfUaValidationResult;

Description

ValidatePdfUa walks the open document looking for the PDF/UA-1 file-format markers defined by ISO 14289-1:2014:

The result is a TPdfUaValidationResult record:

ValidatePdfUa is a read-only inspection — it does not modify the document and is safe to call repeatedly. Use it before handing a PDF off to an archive system or accessibility checker to surface non-compliance to the operator. For the common "is this PDF/UA-1?" check that doesn't need the issue list, prefer the lighter-weight PdfUaConformance property.

Remarks

Example

uses System.TypInfo;

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

See Also

PdfUaConformance, SaveAsPdfUa, SaveAsPdfUaToStream, IsTagged, ValidatePdfA