OCR Results
Get more than just text. Our API provides structured data including coordinates, confidence scores, and a full document hierarchy (pages, lines, words).
Data Output
Texts
IronOCR returns the text output for paragraphs, lines, words, and characters as structured objects and strings, enabling developers to access and manipulate the data quickly.
using IronOcr;
var ocrTesseract = new IronTesseract();
using var ocrInput = new OcrInput();
var pages = new int[] { 1, 2 };
ocrInput.LoadImageFrames("example.tiff", pages);
OcrResult ocrResult = ocrTesseract.Read(ocrInput);
foreach (var page in ocrResult.Pages)
{
// Page text
string PageText = page.Text;
}Imports IronOcr
Dim ocrTesseract As New IronTesseract()
Using ocrInput As New OcrInput()
Dim pages As Integer() = {1, 2}
ocrInput.LoadImageFrames("example.tiff", pages)
Dim ocrResult As OcrResult = ocrTesseract.Read(ocrInput)
For Each page In ocrResult.Pages
' Page text
Dim PageText As String = page.Text
Next
End UsingOCR Texts Location
Get the precise X/Y coordinates and bounding box dimensions for every paragraph, line, word, and character, enabling text highlighting, zonal OCR, and data validation.
Learn how to:Extract Read Results in .NET C#using IronOcr;
using IronOcr.OcrResult;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("sample.jpg");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Retrieve list of detected paragraphs
Paragraph[] paragraphs = ocrResult.Paragraphs;
// Output Text location (X,Y) of the first paragraph
Console.WriteLine($"X: {paragraphs[0].X}");
Console.WriteLine($"Y: {paragraphs[0].Y}");Imports IronOcr
Imports IronOcr.OcrResult
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Add image
Using imageInput As New OcrImageInput("sample.jpg")
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Retrieve list of detected paragraphs
Dim paragraphs() As Paragraph = ocrResult.Paragraphs
' Output Text location (X,Y) of the first paragraph
Console.WriteLine($"X: {paragraphs(0).X}")
Console.WriteLine($"Y: {paragraphs(0).Y}")
End UsingOCR Output confidence
Receive a confidence score for texts extracted. Programmatically flag low-confidence results for human review to build more reliable automation workflows.
Learn how to:Get Read Confidence in .NET C#using IronOcr;
var ocrTesseract = new IronTesseract();
using var ocrInput = new OcrInput();
// Load image from file
ocrInput.LoadImage("sameple.png");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(ocrInput);
// Check Confidence level
Console.WriteLine($"Confidence: {ocrResult.Confidence}%");Imports IronOcr
Dim ocrTesseract = New IronTesseract()
Using ocrInput = New OcrInput()
' Load image from file
ocrInput.LoadImage("sameple.png")
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(ocrInput)
' Check Confidence level
Console.WriteLine($"Confidence: {ocrResult.Confidence}%")
End UsingImages of OCR Elements
In addition to text, export visual elements of texts detected from OCR from the input document as separate image files, useful for archiving or processing non-textual data.
Learn how to:Extract Read Results in .NET C#using IronOcr;
using IronSoftware.Drawing;
var ocrTesseract = new IronTesseract();
using var ocrInput = new OcrInput();
ocrInput.LoadImage("sample.png");
var ocrResult = ocrTesseract.Read(ocrInput);
foreach (var page in ocrResult.Pages)
{
foreach (var word in page.Words)
{
word.ToBitmap(ocrInput).SaveAs($"page{page.PageNumber}_word{word.WordNumber}.png", AnyBitmap.ImageFormat.Png);
}
}Imports IronOcr
Imports IronSoftware.Drawing
Dim ocrTesseract = New IronTesseract()
Using ocrInput = New OcrInput()
ocrInput.LoadImage("sample.png")
Dim ocrResult = ocrTesseract.Read(ocrInput)
For Each page In ocrResult.Pages
For Each word In page.Words
word.ToBitmap(ocrInput).SaveAs($"page{page.PageNumber}_word{word.WordNumber}.png", AnyBitmap.ImageFormat.Png)
Next
Next
End Using
Output Types
Text
Access the OCR results through a structured, hierarchical API. Easily navigate from large paragraphs down to individual characters, giving you granular control over the extracted text and its metadata.
Learn how to:Extract Read Results in .NET C#using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("sample.jpg");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Output the first detected paragraph text
Console.WriteLine($"Text: {ocrResult.Paragraphs[0].Text}");Imports IronOcr
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Add image
Using imageInput As New OcrImageInput("sample.jpg")
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Output the first detected paragraph text
Console.WriteLine($"Text: {ocrResult.Paragraphs(0).Text}")
End UsingSearchable PDFs
Convert any scanned document or image into a fully searchable PDF file. The original layout is preserved, but all text becomes selectable, copyable, and discoverable.
Learn how to:Save Results as a Searchable PDFusing IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Enable render as searchable PDF
ocrTesseract.Configuration.RenderSearchablePdf = true;
// Add image
using var imageInput = new OcrImageInput("sample.tiff");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Export as searchable PDF
ocrResult.SaveAsSearchablePdf("searchablePdf.pdf");Imports IronOcr
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Enable render as searchable PDF
ocrTesseract.Configuration.RenderSearchablePdf = True
' Add image
Using imageInput As New OcrImageInput("sample.tiff")
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Export as searchable PDF
ocrResult.SaveAsSearchablePdf("searchablePdf.pdf")
End UsinghOCR
Export results in the hOCR format, an HTML-based standard that provides rich metadata, including text, layout information, and coordinates for each word, ideal for advanced document analysis.
Learn how to:Save Results as hOCR in an HTML Fileusing IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Enable render as hOCR
ocrTesseract.Configuration.RenderHocr = true;
// Add image
using var imageInput = new OcrImageInput("sample.tiff");
imageInput.Title = "Html Title";
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Export as HTML
ocrResult.SaveAsHocrFile("result.html");Imports IronOcr
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Enable render as hOCR
ocrTesseract.Configuration.RenderHocr = True
' Add image
Using imageInput As New OcrImageInput("sample.tiff")
imageInput.Title = "Html Title"
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Export as HTML
ocrResult.SaveAsHocrFile("result.html")
End UsingHighlight Texts as Images
For debugging and verification, generate an image of the original document with all recognized text highlighted. This provides a quick visual check of the OCR engine's accuracy and text location.
Learn how to:C# Highlight Texts for Debuggingusing IronOcr;
IronTesseract ocrTesseract = new IronTesseract();
using var ocrInput = new OcrInput();
ocrInput.LoadPdf("sample.pdf");
ocrInput.HighlightTextAndSaveAsImages(ocrTesseract, "highlight_page_", ResultHighlightType.Paragraph);Imports IronOcr
Dim ocrTesseract As New IronTesseract()
Using ocrInput As New OcrInput()
ocrInput.LoadPdf("sample.pdf")
ocrInput.HighlightTextAndSaveAsImages(ocrTesseract, "highlight_page_", ResultHighlightType.Paragraph)
End UsingBarcode and QR Code Values
Extract the decoded string values from any barcodes or QR codes found within the document. The API provides this data alongside the text results for a complete data capture solution.
Learn how to:Extract Read Results in .NET C#using IronOcr;
using IronOcr.OcrResult;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Enable barcodes detection
ocrTesseract.Configuration.ReadBarCodes = true;
// Load PDF file
using OcrInput ocrInput = new OcrInput();
ocrInput.LoadPdf("sample.pdf");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(ocrInput);
// Output Barcode value
Console.WriteLine(ocrResult.Barcodes[0].Value);Imports IronOcr
Imports IronOcr.OcrResult
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Enable barcodes detection
ocrTesseract.Configuration.ReadBarCodes = True
' Load PDF file
Using ocrInput As New OcrInput()
ocrInput.LoadPdf("sample.pdf")
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(ocrInput)
' Output Barcode value
Console.WriteLine(ocrResult.Barcodes(0).Value)
End UsingReady to Get Started?
Nuget Downloads 6,236,385|Version:2026.9just released