Enum LayoutElementCategory
Identifies the semantic role of a layout element on a page, as reported by a layout-aware extraction source such as a document-parsing vision-language model.
public enum LayoutElementCategory
Fields
Unknown = 0No category information is available. This is the default for sources that do not classify regions (plain OCR spotting, PDF text extraction).
Text = 1A body text block (paragraph, list, or other running text).
Title = 2A document or section title.
Header = 3A page header (running head at the top of the page).
A page footer (running foot at the bottom of the page).
Figure = 5An illustration, photo, chart, or other graphical region. Figure elements carry no text content; only their bounding box is meaningful.
FigureCaption = 6A caption attached to a figure.
FigureFootnote = 7A footnote attached to a figure.
Table = 8A tabular region. The element text carries the table structure as HTML.
TableCaption = 9A caption attached to a table.
TableFootnote = 10A footnote attached to a table.
Formula = 11A mathematical formula. The element text carries the formula as LaTeX.
FormulaCaption = 12A caption attached to a formula.
PageFootnote = 13A footnote belonging to the page body (not tied to a figure or table).
Examples
foreach (TextElement element in page.TextElements)
{
switch (element.Category)
{
case LayoutElementCategory.Table:
Console.WriteLine($"Table (HTML): {element.Text}");
break;
case LayoutElementCategory.Formula:
Console.WriteLine($"Formula (LaTeX): {element.Text}");
break;
default:
Console.WriteLine($"{element.Category}: {element.Text}");
break;
}
}
Remarks
Layout-aware OCR engines (for example, Infinity-Parser2 through VlmOcr with LayoutAnalysis or OcrWithCoordinates) classify every detected region into one of these categories and expose the result through Category. Sources without layout classification (plain OCR spotting, PDF text extraction) leave the value at Unknown.
Member values are stable and safe to persist. The set grows as models with richer layout vocabularies are integrated; consumers should treat unrecognized future values like Unknown rather than failing.