Read Table in Document
using IronOcr;
using System.Linq;

// Instantiate OCR engine
var ocr = new IronTesseract();

using var input = new OcrInput();
input.LoadPdf("table.pdf");

// Perform OCR
var result = ocr.ReadDocumentAdvanced(input);

var cellList = result.Tables.First().CellInfos;
NuGet Download
PM > Install-Package IronOcr
Read Table in Document

Read Table in Document

This code example demonstrates how to use the IronTesseract OCR engine to extract text and table data from a PDF document.

  1. An instance of the IronTesseract OCR engine is created.
  2. An OcrInput object is initialized, and a PDF file (table.pdf) is loaded using the LoadPdf method.
  3. The OCR engine processes the document using the ReadDocumentAdvanced method, which returns a more detailed OcrResult object.
  4. The first table found in the document is accessed using result.Tables.First(), and the cell information for that table is extracted with CellInfos.
  5. The list of cell data (cellList) now contains the table's cells, including the text content and other details (e.g., cell position, size).
  6. This method is useful for extracting structured data like tables from PDFs, allowing the text within each table cell to be programmatically accessed and processed.
Explore how to read tables in PDFs with IronOCR.
View on GitHub

Ready to Get Started?

Nuget Downloads 6,357,159Version:2026.11just released