function ResolvePdfUaEffectiveLanguage(const CatalogLanguage: WString;
const Elements: TPdfStructureElements; ElementIndex: Integer;
const MarkedContentLanguage: WString; HasMarkedContentLanguage: Boolean;
out Resolution: TPdfUaLanguageResolution): Boolean;
| CatalogLanguage | WString |
| Elements | TPdfStructureElements |
| ElementIndex | Integer |
| MarkedContentLanguage | WString |
| HasMarkedContentLanguage | Boolean |
| Resolution | TPdfUaLanguageResolution |
BooleanResolvePdfUaEffectiveLanguage applies the ISO 14289 language cascade to one content position and fills Resolution with the winning declaration
When HasMarkedContentLanguage is True the marked-content /Lang value wins and Resolution.Source is pulsMarkedContent
Otherwise the element at ElementIndex and its ancestors are walked through ParentIndex until one carries a non-empty Language; Resolution.Source is then pulsStructure and StructureElementIndex records the declaring element
When no structure element declares a language, a non-empty CatalogLanguage applies with Source pulsCatalog
Each candidate is validated with IsPdfUaLanguageTagValid and the outcome is stored in Resolution.DeclarationValid
The function returns Resolution.IsCovered, which is True only when a declaration was found and it is a well-formed tag
When no candidate exists, Resolution keeps Source pulsNone with an empty Language and the result is False
Covered := ResolvePdfUaEffectiveLanguage(Pdf.Language, Elements, I, '', False, Resolution);