PDFium Delphi Component Docs

ValidatePdfUa2FormulaSemantics function

Unit: PDFium
Validates Formula fallback text, MathML containment, and associated-file relationships in a PDF/UA-2 structure tree

Syntax

function ValidatePdfUa2FormulaSemantics(const Elements: TPdfStructureElements): TPdfUaValidationIssues;

Parameters

ElementsTPdfStructureElements

Return Value

TPdfUaValidationIssues

Description

ValidatePdfUa2FormulaSemantics applies ISO 14289-2 §8.2.5.29/1: a math structure element must be nested inside a Formula element or inside another math element. It does not require a Formula element to carry AlternateText, ActualText or an associated file; the PDF/UA-1 §7.7 fallback requirement is handled separately by ValidatePdfUaStructureElements

A math structure element is recognised by its MathML namespace, by a role map that resolves into the MathML namespace, or by the /S /Math role name. The native page snapshot can leave the namespace fields empty, so the role name keeps the parent check effective; a math element whose parent is neither a Formula nor another math element reports pvuaiFormulaSemanticInvalid

Any element with an associated file must carry a non-empty AssociatedFileDescription and one of the seven standard relationships (Source, Data, Alternative, Supplement, EncryptedPayload, FormData or Schema), otherwise pvuaiAssociatedFileSemanticInvalid is reported

Remarks

Example

FormulaIssues := ValidatePdfUa2FormulaSemantics(Pdf.StructureElements);

See Also

ValidatePdfUa2StructureElements, ValidatePdfUa2AssociatedFileSemantics, ClassifyPdfUaNamespace, TPdf.StructureElements