THotPDF.ValidatePDFA4 Method

Validates a generated or loaded object graph against the supported PDF/A-4 base, PDF/A-4e engineering, or PDF/A-4f associated-file profile and returns stable structured diagnostics

Declaração

function ValidatePDFA4(
  const Options: THPDFPDFA4ValidationOptions;
  out Issues: THPDFPDFA4ValidationIssues): boolean; overload;

function ValidatePDFA4(
  const Options: THPDFPDFA4ValidationOptions;
  out Findings: THPDFComplianceFindings): boolean; overload;

Unidade

HPDFDoc

Profile and severity types

THPDFPDFA4Profile = (
  p4pAutomatic,
  p4pBase,
  p4pEngineering,
  p4pAssociatedFiles
);

THPDFPDFA4IssueSeverity = (
  p4isWarning,
  p4isError
);

THPDFPDFA4Profile selects metadata inference or an explicit conformance profile, while THPDFPDFA4IssueSeverity distinguishes advisory diagnostics from validation errors

Opções

CampoFinalidade
ProfileSelects automatic metadata-based detection, base, engineering, or associated-file validation
MaxObjectsBounds iterative object-graph traversal and defaults to 1,000,000 objects
MaxIssuesBounds retained diagnostics and defaults to 1,024 issues
CheckEmbeddedFontsChecks rendering fonts for an embedded font program
CheckAnnotationAppearancesChecks annotation flags and normal appearance streams
CheckOptionalContentChecks optional-content configuration names and uniqueness

Diagnósticos

Each THPDFPDFA4ValidationIssue reports severity, a stable namespaced code, the applicable ISO 19005-4 clause, object path, object number, zero-based page index when known, and a human-readable message

O THPDFComplianceFindings overload exposes the same traversal through the shared machine-readable finding model with a PDF/A-4 profile and crsNotAttempted estado de reparação

The validator covers PDF 2.0 identification, trailer ID and encryption state, XMP UTF-8 and PDF/A identification, Info restrictions, output intents, font embedding, annotations and appearances, AcroForm restrictions, actions and additional actions, associated files, optional content, external references, and profile-specific 3D or attachment rules

Exemplo

var
  Options: THPDFPDFA4ValidationOptions;
  Issues: THPDFPDFA4ValidationIssues;
begin
  Options := THPDFPDFA4ValidationOptions.Default;
  Options.Profile := p4pAutomatic;
  if not PDF.ValidatePDFA4(Options, Issues) then
    raise Exception.CreateFmt('%s at %s',
      [String(Issues[0].Code), String(Issues[0].Path)]);
end;

Generation behavior

EndDoc automatically runs the validator for '4', '4E', and '4F' and raises before serialization when an error remains

PDF/A-4 generation omits the trailer Info entry, PDF/A-4f always creates the required EmbeddedFiles name tree, and file-attachment annotations are accepted only by PDF/A-4f where the embedded stream, Filespec, AF relationship, Catalog AF array, and name tree are emitted together

APIs relacionadas