PDFium Delphi Component Docs

ValidatePdfUa2TableGrid function

Unit: PDFium
Replays each PDF/UA-2 table into a bounded rectangular grid and reports span, overlap, and gap defects

Syntax

function ValidatePdfUa2TableGrid(const Elements: TPdfStructureElements): TPdfUaValidationIssues;

Parameters

ElementsTPdfStructureElements

Return Value

TPdfUaValidationIssues

Description

ValidatePdfUa2TableGrid locates every Table element and simulates its rows and cells in a rectangular occupancy grid using the ColSpan and RowSpan attributes recorded on the TH and TD elements, with absent spans counting as 1

A TR row belongs to a table when its nearest Table ancestor is that element, so nested tables are validated independently

The table is reported as pvuaiTableGridInvalid when a cell overlaps an occupied grid cell, a span is negative or exceeds the 4096-column bound, a row leaves gaps before its last occupied column, rows have inconsistent widths, a RowSpan is still open beyond the last row, or the table declares no rows at all

A TH element with a Scope attribute other than Row, Column or Both is also invalid

Header ID resolution is not part of the grid simulation. pvuaiTableHeadersUndefinedId reports a Headers association only when no structure element in the document defines an ID at all; a single dangling entry beside resolvable IDs is tolerated, matching the authoritative validator

TPdf.ValidatePdfUa uses the active structure tree where it can read it. That tree retains empty cells without /K and their spans across page boundaries. The document-level check uses the first row to determine the column count and validates RowSpan within each THead, TBody or TFoot grouping

Remarks

Example

TableIssues := ValidatePdfUa2TableGrid(Pdf.StructureElements);

See Also

ValidatePdfUa2StructureElements, ValidatePdfUa2Containment, ValidatePdfUaStructureElements, TPdf.StructureElements