PDFium Delphi Component Docs

ValidatePdfUa2Containment function

Unit: PDFium
Validates the ISO/TS 32005 parent-child containment model of a PDF/UA-2 structure tree

Syntax

function ValidatePdfUa2Containment(const Elements: TPdfStructureElements): TPdfUaValidationIssues;

Parameters

ElementsTPdfStructureElements

Return Value

TPdfUaValidationIssues

Description

ValidatePdfUa2Containment walks the ParentIndex links of the flattened structure data and verifies that every element sits in an allowed parent for the ISO/TS 32005 containment model

Only a Document element may be a root, and a Document element may not have a parent; a parent index that is out of range or points at the element itself is also invalid

DocumentFragment and Title may only appear under Document, DocumentFragment, Part, Art, Sect, Div, or Aside

LI requires an L parent; Lbl requires LI, FENote, Note, or BibEntry; LBody requires LI

THead, TBody, and TFoot require a Table parent; TR requires Table, THead, TBody, or TFoot; TH and TD require TR

TOCI requires TOC or TOCI; Caption requires TOC, Table, Figure, Formula, or Aside

A MathML-namespaced element must sit inside a Formula element or inside another MathML-namespaced element

Every violation is reported as pvuaiNamespaceContainmentInvalid

Remarks

Example

ContainmentIssues := ValidatePdfUa2Containment(Pdf.StructureElements);

See Also

ValidatePdfUa2StructureElements, ClassifyPdfUaNamespace, ValidatePdfUa2NamespaceSemantics, TPdf.StructureElements