THPDFSemanticTextLayout Record
The result of semantic reading-order analysis over positioned page glyphs
THPDFSemanticTextLayout = record
Lines: THPDFSemanticTextLines;
ColumnCount: Integer;
TableCount: Integer;
MedianAdvance: Double;
MedianFontSize: Double;
end;
The unit is HPDFContentStream; Lines holds the detected reading-order lines with cell, zone, table, list-level and source-order metadata
Line records
Every Lines element is a THPDFSemanticTextLine:
THPDFSemanticTextLine = record
Text: UnicodeString;
Cells: THPDFSemanticTextCells;
Kind: THPDFSemanticBlockKind;
Left, Bottom, Right, Top: Double;
BaselineY: Double;
FontSize: Double;
ColumnIndex: Integer;
ZoneIndex: Integer;
TableIndex: Integer;
TableRowIndex: Integer;
ListLevel: Integer;
SourceOrder: Integer;
end;
Text carries the line text, Cells holds any table cells it has, and Kind classifies the line by block role
Left, Bottom, Right and Top are the line box in user space; BaselineY is the baseline and FontSize the dominant font size
ColumnIndex and ZoneIndex identify the reading column and zone, whilst TableIndex, TableRowIndex, ListLevel and SourceOrder locate the line inside a table, a list and the original glyph order
Cell records
Every Cells element is a THPDFSemanticTextCell:
THPDFSemanticTextCell = record
Text: UnicodeString;
Left, Bottom, Right, Top: Double;
FirstGlyphIndex, LastGlyphIndex: Integer;
end;
Text carries the cell text and the four box fields describe the cell in user space; FirstGlyphIndex and LastGlyphIndex are inclusive indices into the page glyph array
Block kinds
THPDFSemanticBlockKind classifies THPDFSemanticTextLine.Kind with sbkParagraph, sbkHeading, sbkListItem, sbkTableRow and sbkCaption
ColumnCount and TableCount summarise the detected structure, whilst the two medians characterise typical glyph advance and font size in user-space points
The record gets filled by HPDFAnalyzeSemanticTextLayout and surfaced per page by THPDFHeadlessDocument.AnalyzePageSemanticText and the loaded-document equivalents