THotPDF.AnalyzeLoadedPageSemanticText

Analyses positioned glyphs and returns semantic lines in stable reading order

Delphi syntax

function AnalyzeLoadedPageSemanticText(PageIndex: Integer;
  out ALayout: THPDFSemanticTextLayout): boolean;

Description

The analyser clusters baselines, splits large horizontal gaps into cells, detects recurring column bands, recognizes aligned table rows, and classifies list items, headings, and figure or table captions. A run of full-width lines, and the rows of one table, form a vertical zone, while ordinary content is ordered column-first and then top-to-bottom inside each column. Only the glyphs inside the visible box given by GetLoadedPageVisibleBox are taken, and distances are measured in page units, so text sized through the text matrix is handled like text sized through the font size; the page medians are page-unit values

THPDFSemanticTextLayout reports ColumnCount, TableCount, page medians, and ordered Lines. Every line retains bounds, cells, role, column and zone, table and row indices, list level, and original source order so applications can replace the built-in heuristics

The geometry pass uses O(n log n) sorting and bounded column-band assignment

See also ExtractLoadedPageSemanticText