IRONSOFTWAREHOME
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;
Imports IronOcr
Imports System.Linq

' Instantiate OCR engine
Dim ocr = New IronTesseract()

Using input = New OcrInput()
    input.LoadPdf("table.pdf")

    ' Perform OCR
    Dim result = ocr.ReadDocumentAdvanced(input)

    Dim cellList = result.Tables.First().CellInfos
End Using
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,236,385Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required