function InspectPdfUaLanguageCoverage: TPdfUaLanguageCoverageReport; overload;
function InspectPdfUaLanguageCoverage(const Options: TPdfUaLanguageCoverageOptions): TPdfUaLanguageCoverageReport; overload;
The method scans non-Artifact text page objects plus structure-element Title, AlternateText, ActualText, and Expansion strings
Effective language follows ISO 14289-1 inheritance order: the innermost marked-content /Lang declaration, the nearest structure ancestor with a language, then the catalog language
An invalid nearer declaration remains authoritative and produces uncovered evidence instead of falling through to a valid outer declaration
Each TPdfUaLanguageSpan records PageNumber, PageObjectIndex, MCID, StructureElementIndex, a ContentKind of pulckPageText, pulckTitle, pulckAlternateText, pulckActualText, or pulckExpansion, the full CharacterCount, a bounded Text excerpt flagged by TextTruncated, and the effective language with its DeclarationValid state
Language resolution is reported through TPdfUaLanguageResolution with the Language tag, a Source of pulsNone, pulsCatalog, pulsStructure, or pulsMarkedContent, the originating StructureElementIndex, DeclarationValid, and the IsCovered helper
The default options store only uncovered spans, cap evidence at 1000 spans, and cap each excerpt at 256 characters while aggregate counts continue across the whole document
Completed is False when required PDFium APIs are unavailable, a page cannot be loaded, or bounded structure traversal cannot finish; already collected evidence remains available
| Member | Purpose |
|---|---|
IncludeCoveredSpans | Stores covered evidence as well as uncovered evidence |
MaxReportedSpans | Caps stored evidence without stopping aggregate counting |
MaxTextCharactersPerSpan | Caps each stored excerpt while preserving CharacterCount |
CoveredSpanCount, UncoveredSpanCount | Aggregate language-coverage counts alongside NaturalLanguageSpanCount |
DocumentLanguage, PageCount, PagesScanned | Catalog language tag and page-scan progress of the TPdfUaLanguageCoverageReport |
ReportLimitReached | Indicates that additional matching spans were counted but not stored |
IsCovered | Returns True only for a completed scan with no uncovered spans |
var Report: TPdfUaLanguageCoverageReport;
Report := Pdf1.InspectPdfUaLanguageCoverage;
if Report.Completed and (Report.UncoveredSpanCount > 0) then
ShowMessage(IntToStr(Report.UncoveredSpanCount) + ' language declarations required');