Class OcrResult.Table
Represents a Visual Table with Borders discovered during OCR.
To enable table reading, set IronTesseract's Configuration.ReadDataTables to true.
var Ocr = new IronTesseract();
Ocr.Configuration.ReadDataTables = true;
Implements
Inherited Members
Namespace: IronOcr
Assembly: IronOcr.dll
Syntax
public class Table : OcrResult.OcrResultTextElement
When OCR detects a grid of cells on a page, OcrResult.Table is how you read it back as structured data rather than loose text. Each table is a grouping of lines the engine recognized as tabular, exposed in a form you can load straight into a System.Data.DataTable.
Tables come from a page: OcrResult.Page.Tables returns an array of Table, one per detected grid. Each table derives from OcrResult.OcrResultTextElement, so the shared Text, Confidence, and BoundingBox members describe the table region as a whole, while the table-specific members give you the cell contents and geometry.
The headline member is DataTable, the recognized contents as a System.Data.DataTable ready to bind, export, or query. For placement, GetLocation returns the bounding Rectangle on the page, and X, Y, Width, and Height give the same box as individual pixel values for the top-left corner and size. Read DataTable when you want the data and the location members when you need to crop, highlight, or position the table on the original image.
The read tables in a document how-to works a detected table into a DataTable, and the read table example shows the full read.
Properties
DataTable
Contents of the detected Table in a DataTable form.
Declaration
public DataTable DataTable { get; }
Property Value
| Type | Description |
|---|---|
| System.Data.DataTable |
GetLocation
Bounding Box of this OcrResult.Table location on the Page./>
Declaration
public Rectangle GetLocation { get; }
Property Value
| Type | Description |
|---|---|
| IronSoftware.Drawing.Rectangle |
Height
Height in pixels of this table.
Declaration
public int Height { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Width
Width in pixels of this table.
Declaration
public int Width { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
X
X coordinate in pixels of the top left side of this table.
Declaration
public int X { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Y
Y coordinate in pixels of the top left side of this table.
Declaration
public int Y { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |