IronSoftware
  • Products
    for .NET Java
    Create, read, and edit PDFs
    for .NET
    Image to text in 127 languages
    for .NET
    Read and write QR & Barcodes
    for .NET
    No Office Interop required
    for .NET
    Extract structured data from websites
    5 for the Price of 2 All 5 .NET product licenses from $1498 Save 60% with Iron Suite Iron Suites - Donate $50
  • Open Source
    for .NET
    System.Drawing.Common Replacement
  • About Us
  • Contact Us

205 N. Michigan Ave. Chicago, IL 60611, USA +1 (312) 500-3060

Join Iron Slack

  • Home
  • Licensing
  • EULA
  • Support & Update Extensions
  • License Upgrades
  • Get Started
  • Features
  • Languages
  • Code Examples
  • Tutorials
  • How-Tos
  • Troubleshooting
  • Product Updates
  • API Reference
  • Search
  • Free NuGet Download
IronOCR Library for C# IronOCR Library for C#
  • Home
  • Licensing
    • Licensing
    • EULA
    • Support & Update Extensions
    • License Upgrades
  • Docs
    • Search
    • Get Started
    • Features
    • Languages
    • Code Examples
    • Tutorials
    • How-Tos
    • Troubleshooting
    • Product Updates
    • API Reference
    • Search
  • Search
  • Free NuGet Download Total downloads: 633,508
Message's icon

The C# OCR Library

  • # OCR for C# to scan and read images & PDFs
  • # .NET OCR library with 127+ global language packs
  • # Output as text, structured data, or searchable PDFs
  • # Supports .NET 7, 6, 5, Core, Standard, Framework
Explore IronOCR Free NuGet Download

Examples

  • OCR in 1 line of code
  • PDF OCR Text Extraction
  • OCR with Barcode & QR Reading
  • 125 International OCR Languages
  • Fixing Low Quality Scans & Images
  • Fast OCR Configuration
  • OCR Image Optimization Filters
  • OCR Image Color Editing
  • OcrResult Class
  • Create Searchable PDFs by OCR
  • Tesseract 5 for .NET
  • Tesseract Detailed Configuration
  • OcrInput Class
  • OCR a Region of an Image
  • TIFF to Searchable PDF Converter
  • Image Resolution Optimization (DPI)
  • MultithreadedTesseract OCR
  • OCR Progress and Performance Tracking
  • OCR for MultiPage TIFF Files
  • Make any PDF have Searchable, Copyable Text
  • Using Custom Tesseract Language Files
  • Multiple Languages for 1 Document
  • Exporting Images of OCR Elements
OCR in 1 line of code
// NuGet PM> Install-Package IronOcr
using IronOcr;

string imageText = new IronTesseract().Read(@"images\image.png").Text;
' NuGet PM> Install-Package IronOcr
Imports IronOcr

Private imageText As String = (New IronTesseract()).Read("images\image.png").Text
PDF OCR Text Extraction
using IronOcr;
using System;

var ocrTesseract = new IronTesseract();

using (var ocrInput = new OcrInput())
{
    // OCR entire document
    ocrInput.AddPdf("example.pdf", "password");

    // Alternatively OCR selected page numbers
    ocrInput.AddPdfPages("example.pdf", new[] { 1, 2, 3 }, "password");

    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}
Imports IronOcr
Imports System

Private ocrTesseract = New IronTesseract()

Using ocrInput As New OcrInput()
	' OCR entire document
	ocrInput.AddPdf("example.pdf", "password")

	' Alternatively OCR selected page numbers
	ocrInput.AddPdfPages("example.pdf", { 1, 2, 3 }, "password")

	Dim ocrResult = ocrTesseract.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using
OCR with Barcode & QR Reading
using IronOcr;
using System;

var ocrTesseract = new IronTesseract();
ocrTesseract.Configuration.ReadBarCodes = true;
using (var ocrInput = new OcrInput(@"images\imageWithBarcode.png"))
{
    var ocrResult = ocrTesseract.Read(ocrInput);
    foreach (var barcode in ocrResult.Barcodes)
    {
        Console.WriteLine(barcode.Value);
    }
}
Imports IronOcr
Imports System

Private ocrTesseract = New IronTesseract()
ocrTesseract.Configuration.ReadBarCodes = True
Using ocrInput As New OcrInput("images\imageWithBarcode.png")
	Dim ocrResult = ocrTesseract.Read(ocrInput)
	For Each barcode In ocrResult.Barcodes
		Console.WriteLine(barcode.Value)
	Next barcode
End Using
125 International OCR Languages
//PM> Install-Package IronOcr.Languages.Arabic
using IronOcr;
using System;

var ocrTesseract = new IronTesseract();

ocrTesseract.Language = OcrLanguage.Arabic;

using (var ocrInput = new OcrInput(@"images\arabic.gif"))
{
    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}

// Example with a Custom Trained Font Being used:

var ocrTesseractCustomerLang = new IronTesseract();
ocrTesseractCustomerLang.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");
ocrTesseractCustomerLang.AddSecondaryLanguage(OcrLanguage.EnglishBest);

using (var ocrInput = new OcrInput(@"images\mixed-lang.pdf"))
{
    var ocrResult = ocrTesseractCustomerLang.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}
'PM> Install-Package IronOcr.Languages.Arabic
Imports IronOcr
Imports System

Private ocrTesseract = New IronTesseract()

ocrTesseract.Language = OcrLanguage.Arabic

Using ocrInput As New OcrInput("images\arabic.gif")
	Dim ocrResult = ocrTesseract.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using

' Example with a Custom Trained Font Being used:

Dim ocrTesseractCustomerLang = New IronTesseract()
ocrTesseractCustomerLang.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata")
ocrTesseractCustomerLang.AddSecondaryLanguage(OcrLanguage.EnglishBest)

Using ocrInput As New OcrInput("images\mixed-lang.pdf")
	Dim ocrResult = ocrTesseractCustomerLang.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using
Fixing Low Quality Scans & Images
using IronOcr;
using System;

var ocrTesseract = new IronTesseract();
using (var ocrInput = new OcrInput(@"images\image.png"))
{
    ocrInput.Deskew();
    ocrInput.DeNoise();
    ocrInput.Despeckle();
    ocrInput.EnhanceResolution(225);
    ocrInput.Sharpen();
    ocrInput.Erode();
    ocrInput.Dilate();
    ocrInput.Scale(200);
    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}
Imports IronOcr
Imports System

Private ocrTesseract = New IronTesseract()
Using ocrInput As New OcrInput("images\image.png")
	ocrInput.Deskew()
	ocrInput.DeNoise()
	ocrInput.Despeckle()
	ocrInput.EnhanceResolution(225)
	ocrInput.Sharpen()
	ocrInput.Erode()
	ocrInput.Dilate()
	ocrInput.Scale(200)
	Dim ocrResult = ocrTesseract.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using
Fast OCR Configuration
using IronOcr;
using System;

var ocrTesseract = new IronTesseract();

// Fast Dictionary
ocrTesseract.Language = OcrLanguage.EnglishFast;

// Turn off unneeded options
ocrTesseract.Configuration.ReadBarCodes = false;
ocrTesseract.Configuration.RenderSearchablePdfsAndHocr = false;

// Assume text is laid out neatly in an orthogonal document
ocrTesseract.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.Auto;

using (var ocrInput = new OcrInput(@"images\image.png"))
{
    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}
Imports IronOcr
Imports System

Private ocrTesseract = New IronTesseract()

' Fast Dictionary
ocrTesseract.Language = OcrLanguage.EnglishFast

' Turn off unneeded options
ocrTesseract.Configuration.ReadBarCodes = False
ocrTesseract.Configuration.RenderSearchablePdfsAndHocr = False

' Assume text is laid out neatly in an orthogonal document
ocrTesseract.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.Auto

Using ocrInput As New OcrInput("images\image.png")
	Dim ocrResult = ocrTesseract.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using
OCR Image Optimization Filters
using IronOcr;
using System;

var ocrTesseract = new IronTesseract();
using (var ocrInput = new OcrInput(@"images\image.png"))
{
    // Note: You don't need all of them; most users only need Deskew() and occasionally DeNoise()
    ocrInput.WithTitle("My Document");
    ocrInput.Binarize();
    ocrInput.Contrast();
    ocrInput.Deskew();
    ocrInput.DeNoise();
    ocrInput.Despeckle();
    ocrInput.Dilate();
    ocrInput.EnhanceResolution(300);
    ocrInput.Invert();
    ocrInput.Rotate(90);
    ocrInput.Scale(150);
    ocrInput.Sharpen();
    ocrInput.ToGrayScale();
    ocrInput.Erode();

    // WIZARD - If you are unsure use the debug-wizard to test all combinations:
    string codeToRun = OcrInputFilterWizard.Run(@"images\image.png", out double confidence, ocrTesseract);
    Console.WriteLine(codeToRun);

    // Optional: Export modified images so you can view them.
    foreach (var page in ocrInput.Pages)
    {
        page.SaveAsImage($"filtered_{page.Index}.bmp");
    }

    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}
Imports IronOcr
Imports System

Private ocrTesseract = New IronTesseract()
Using ocrInput As New OcrInput("images\image.png")
	' Note: You don't need all of them; most users only need Deskew() and occasionally DeNoise()
	ocrInput.WithTitle("My Document")
	ocrInput.Binarize()
	ocrInput.Contrast()
	ocrInput.Deskew()
	ocrInput.DeNoise()
	ocrInput.Despeckle()
	ocrInput.Dilate()
	ocrInput.EnhanceResolution(300)
	ocrInput.Invert()
	ocrInput.Rotate(90)
	ocrInput.Scale(150)
	ocrInput.Sharpen()
	ocrInput.ToGrayScale()
	ocrInput.Erode()

	' WIZARD - If you are unsure use the debug-wizard to test all combinations:
	Dim confidence As Double
	Dim codeToRun As String = OcrInputFilterWizard.Run("images\image.png", confidence, ocrTesseract)
	Console.WriteLine(codeToRun)

	' Optional: Export modified images so you can view them.
	For Each page In ocrInput.Pages
		page.SaveAsImage($"filtered_{page.Index}.bmp")
	Next page

	Dim ocrResult = ocrTesseract.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using
OCR Image Color Editing
using IronOcr;
using IronSoftware.Drawing;
using System;

var ocrTesseract = new IronTesseract();

using (var ocrInput = new OcrInput("blue_and_pink.png"))
{
    ocrInput.WithTitle("Recolored");

    ocrInput.ReplaceColor(Color.Pink, Color.White, 10);
    // Pink detection has 10% tolerance

    ocrInput.ReplaceColor(Color.Blue, Color.Black, 5);
    // Blue detection has 5% tolerance

    // Export the modified image so you can manually inspect it.
    foreach (var page in ocrInput.Pages)
    {
        page.SaveAsImage($"black_and_white_page_{page.Index}.bmp");
    }

    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}
Imports IronOcr
Imports IronSoftware.Drawing
Imports System

Private ocrTesseract = New IronTesseract()

Using ocrInput As New OcrInput("blue_and_pink.png")
	ocrInput.WithTitle("Recolored")

	ocrInput.ReplaceColor(Color.Pink, Color.White, 10)
	' Pink detection has 10% tolerance

	ocrInput.ReplaceColor(Color.Blue, Color.Black, 5)
	' Blue detection has 5% tolerance

	' Export the modified image so you can manually inspect it.
	For Each page In ocrInput.Pages
		page.SaveAsImage($"black_and_white_page_{page.Index}.bmp")
	Next page

	Dim ocrResult = ocrTesseract.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using
OcrResult Class
using IronOcr;
using IronSoftware.Drawing;

// We can delve deep into OCR results as an object model of
// Pages, Barcodes, Paragraphs, Lines, Words and Characters
// This allows us to explore, export and draw OCR content using other APIs/
var ocrTesseract = new IronTesseract();

ocrTesseract.Configuration.ReadBarCodes = true;

using (var ocrInput = new OcrInput(@"example.tiff"))
{
    OcrResult ocrResult = ocrTesseract.Read(ocrInput);
    foreach (var page in ocrResult.Pages)
    {
        // Page object
        int PageNumber = page.PageNumber;
        string PageText = page.Text;
        int PageWordCount = page.WordCount;
        // null if we dont set Ocr.Configuration.ReadBarCodes = true;
        OcrResult.Barcode[] Barcodes = page.Barcodes;
        AnyBitmap PageImage = page.ToBitmap(ocrInput);
        int PageWidth = page.Width;
        int PageHeight = page.Height;
        double PageRotation = page.Rotation; // angular correction in degrees from OcrInput.Deskew()

        foreach (var paragraph in page.Paragraphs)
        {
            // Pages -> Paragraphs
            int ParagraphNumber = paragraph.ParagraphNumber;
            string ParagraphText = paragraph.Text;
            AnyBitmap ParagraphImage = paragraph.ToBitmap(ocrInput);
            int ParagraphX_location = paragraph.X;
            int ParagraphY_location = paragraph.Y;
            int ParagraphWidth = paragraph.Width;
            int ParagraphHeight = paragraph.Height;
            double ParagraphOcrAccuracy = paragraph.Confidence;
            OcrResult.TextFlow paragrapthText_direction = paragraph.TextDirection;
            foreach (var line in paragraph.Lines)
            {
                // Pages -> Paragraphs -> Lines
                int LineNumber = line.LineNumber;
                string LineText = line.Text;
                AnyBitmap LineImage = line.ToBitmap(ocrInput);
                int LineX_location = line.X;
                int LineY_location = line.Y;
                int LineWidth = line.Width;
                int LineHeight = line.Height;
                double LineOcrAccuracy = line.Confidence;
                double LineSkew = line.BaselineAngle;
                double LineOffset = line.BaselineOffset;
                foreach (var word in line.Words)
                {
                    // Pages -> Paragraphs -> Lines -> Words
                    int WordNumber = word.WordNumber;
                    string WordText = word.Text;
                    AnyBitmap WordImage = word.ToBitmap(ocrInput);
                    int WordX_location = word.X;
                    int WordY_location = word.Y;
                    int WordWidth = word.Width;
                    int WordHeight = word.Height;
                    double WordOcrAccuracy = word.Confidence;
                    foreach (var character in word.Characters)
                    {
                        // Pages -> Paragraphs -> Lines -> Words -> Characters
                        int CharacterNumber = character.CharacterNumber;
                        string CharacterText = character.Text;
                        AnyBitmap CharacterImage = character.ToBitmap(ocrInput);
                        int CharacterX_location = character.X;
                        int CharacterY_location = character.Y;
                        int CharacterWidth = character.Width;
                        int CharacterHeight = character.Height;
                        double CharacterOcrAccuracy = character.Confidence;
                        // Output alternative symbols choices and their probability.
                        // Very useful for spellchecking
                        OcrResult.Choice[] Choices = character.Choices;
                    }
                }
            }
        }
    }
}
Imports IronOcr
Imports IronSoftware.Drawing

' We can delve deep into OCR results as an object model of
' Pages, Barcodes, Paragraphs, Lines, Words and Characters
' This allows us to explore, export and draw OCR content using other APIs/
Private ocrTesseract = New IronTesseract()

ocrTesseract.Configuration.ReadBarCodes = True

Using ocrInput As New OcrInput("example.tiff")
	Dim ocrResult As OcrResult = ocrTesseract.Read(ocrInput)
	For Each page In ocrResult.Pages
		' Page object
		Dim PageNumber As Integer = page.PageNumber
		Dim PageText As String = page.Text
		Dim PageWordCount As Integer = page.WordCount
		' null if we dont set Ocr.Configuration.ReadBarCodes = true;
		Dim Barcodes() As OcrResult.Barcode = page.Barcodes
		Dim PageImage As AnyBitmap = page.ToBitmap(ocrInput)
		Dim PageWidth As Integer = page.Width
		Dim PageHeight As Integer = page.Height
		Dim PageRotation As Double = page.Rotation ' angular correction in degrees from OcrInput.Deskew()

		For Each paragraph In page.Paragraphs
			' Pages -> Paragraphs
			Dim ParagraphNumber As Integer = paragraph.ParagraphNumber
			Dim ParagraphText As String = paragraph.Text
			Dim ParagraphImage As AnyBitmap = paragraph.ToBitmap(ocrInput)
			Dim ParagraphX_location As Integer = paragraph.X
			Dim ParagraphY_location As Integer = paragraph.Y
			Dim ParagraphWidth As Integer = paragraph.Width
			Dim ParagraphHeight As Integer = paragraph.Height
			Dim ParagraphOcrAccuracy As Double = paragraph.Confidence
			Dim paragrapthText_direction As OcrResult.TextFlow = paragraph.TextDirection
			For Each line In paragraph.Lines
				' Pages -> Paragraphs -> Lines
				Dim LineNumber As Integer = line.LineNumber
				Dim LineText As String = line.Text
				Dim LineImage As AnyBitmap = line.ToBitmap(ocrInput)
				Dim LineX_location As Integer = line.X
				Dim LineY_location As Integer = line.Y
				Dim LineWidth As Integer = line.Width
				Dim LineHeight As Integer = line.Height
				Dim LineOcrAccuracy As Double = line.Confidence
				Dim LineSkew As Double = line.BaselineAngle
				Dim LineOffset As Double = line.BaselineOffset
				For Each word In line.Words
					' Pages -> Paragraphs -> Lines -> Words
					Dim WordNumber As Integer = word.WordNumber
					Dim WordText As String = word.Text
					Dim WordImage As AnyBitmap = word.ToBitmap(ocrInput)
					Dim WordX_location As Integer = word.X
					Dim WordY_location As Integer = word.Y
					Dim WordWidth As Integer = word.Width
					Dim WordHeight As Integer = word.Height
					Dim WordOcrAccuracy As Double = word.Confidence
					For Each character In word.Characters
						' Pages -> Paragraphs -> Lines -> Words -> Characters
						Dim CharacterNumber As Integer = character.CharacterNumber
						Dim CharacterText As String = character.Text
						Dim CharacterImage As AnyBitmap = character.ToBitmap(ocrInput)
						Dim CharacterX_location As Integer = character.X
						Dim CharacterY_location As Integer = character.Y
						Dim CharacterWidth As Integer = character.Width
						Dim CharacterHeight As Integer = character.Height
						Dim CharacterOcrAccuracy As Double = character.Confidence
						' Output alternative symbols choices and their probability.
						' Very useful for spellchecking
						Dim Choices() As OcrResult.Choice = character.Choices
					Next character
				Next word
			Next line
		Next paragraph
	Next page
End Using
Create Searchable PDFs by OCR
using IronOcr;

var ocrTesseract = new IronTesseract();

using (var ocrInput = new OcrInput())
{
    ocrInput.AddImage(@"images\page1.png");
    ocrInput.AddImage(@"images\page2.bmp");
    ocrInput.AddImage(@"images\page3.tiff");

    ocrInput.Deskew();

    var ocrResult = ocrTesseract.Read(ocrInput);

    ocrResult.SaveAsSearchablePdf("searchable.pdf");
}
Imports IronOcr

Private ocrTesseract = New IronTesseract()

Using ocrInput As New OcrInput()
	ocrInput.AddImage("images\page1.png")
	ocrInput.AddImage("images\page2.bmp")
	ocrInput.AddImage("images\page3.tiff")

	ocrInput.Deskew()

	Dim ocrResult = ocrTesseract.Read(ocrInput)

	ocrResult.SaveAsSearchablePdf("searchable.pdf")
End Using
Tesseract 5 for .NET
using IronOcr;
using System;

var ocrTesseract = new IronTesseract();

// This is done by default and can be omitted:
// ocrTesseract.Configuration.TesseractVersion = TesseractVersion.Tesseract5;

using (var ocrInput = new OcrInput(@"images\image.png"))
{
    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}
Imports IronOcr
Imports System

Private ocrTesseract = New IronTesseract()

' This is done by default and can be omitted:
' ocrTesseract.Configuration.TesseractVersion = TesseractVersion.Tesseract5;

Using ocrInput As New OcrInput("images\image.png")
	Dim ocrResult = ocrTesseract.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using
Tesseract Detailed Configuration
using IronOcr;
using System;

var ocrTesseract = new IronTesseract()
{
    Language = OcrLanguage.EnglishBest,
    Configuration = new TesseractConfiguration()
    {
        ReadBarCodes = false,
        BlackListCharacters = "`ë|^",
        RenderSearchablePdfsAndHocr = true,
        PageSegmentationMode = TesseractPageSegmentationMode.AutoOsd,
    }
};

using (var ocrInput = new OcrInput(@"images\image.png"))
{
    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}
Imports IronOcr
Imports System

Private ocrTesseract = New IronTesseract() With {
	.Language = OcrLanguage.EnglishBest,
	.Configuration = New TesseractConfiguration() With {
		.ReadBarCodes = False,
		.BlackListCharacters = "`ë|^",
		.RenderSearchablePdfsAndHocr = True,
		.PageSegmentationMode = TesseractPageSegmentationMode.AutoOsd
	}
}

Using ocrInput As New OcrInput("images\image.png")
	Dim ocrResult = ocrTesseract.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using
OcrInput Class
using IronOcr;
using System;

var ocrTesseract = new IronTesseract();

using (var ocrInput = new OcrInput(@"images\image.png"))
{
    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}
Imports IronOcr
Imports System

Private ocrTesseract = New IronTesseract()

Using ocrInput As New OcrInput("images\image.png")
	Dim ocrResult = ocrTesseract.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using
OCR a Region of an Image
using IronOcr;
using IronSoftware.Drawing;
using System;

var ocrTesseract = new IronTesseract();

using (var ocrInput = new OcrInput())
{
    // A 41% improvement on speed by specifiying a pixel region
    var ContentArea = new CropRectangle(x: 215, y: 1250, width: 1335, height: 280);
    ocrInput.AddImage("img/example.png", ContentArea);

    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}
Imports IronOcr
Imports IronSoftware.Drawing
Imports System

Private ocrTesseract = New IronTesseract()

Using ocrInput As New OcrInput()
	' A 41% improvement on speed by specifiying a pixel region
	Dim ContentArea = New CropRectangle(x:= 215, y:= 1250, width:= 1335, height:= 280)
	ocrInput.AddImage("img/example.png", ContentArea)

	Dim ocrResult = ocrTesseract.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using
TIFF to Searchable PDF Converter
using IronOcr;

var ocrTesseract = new IronTesseract();

using (var ocrInput = new OcrInput())
{
    ocrInput.AddMultiFrameTiff("images/multiframe.tiff");

    var ocrResult = ocrTesseract.Read(ocrInput);

    ocrResult.SaveAsSearchablePdf("searchable.pdf");
}
Imports IronOcr

Private ocrTesseract = New IronTesseract()

Using ocrInput As New OcrInput()
	ocrInput.AddMultiFrameTiff("images/multiframe.tiff")

	Dim ocrResult = ocrTesseract.Read(ocrInput)

	ocrResult.SaveAsSearchablePdf("searchable.pdf")
End Using
Image Resolution Optimization (DPI)
using IronOcr;
using System;

var ocrTesseract = new IronTesseract();

using (var ocrInput = new OcrInput(@"images\image.png"))
{
    ocrInput.TargetDPI = 300;

    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}
Imports IronOcr
Imports System

Private ocrTesseract = New IronTesseract()

Using ocrInput As New OcrInput("images\image.png")
	ocrInput.TargetDPI = 300

	Dim ocrResult = ocrTesseract.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using
MultithreadedTesseract OCR
using IronOcr;

var ocrTesseract = new IronTesseract();

using (var ocrInput = new OcrInput())
{
    ocrInput.AddPdf("scan.pdf");

    // Image processing is automatically multi-threaded
    ocrInput.Deskew();

    // OCR reading is automatically multi-threaded too
    var ocrResult = ocrTesseract.Read(ocrInput);
}
Imports IronOcr

Private ocrTesseract = New IronTesseract()

Using ocrInput As New OcrInput()
	ocrInput.AddPdf("scan.pdf")

	' Image processing is automatically multi-threaded
	ocrInput.Deskew()

	' OCR reading is automatically multi-threaded too
	Dim ocrResult = ocrTesseract.Read(ocrInput)
End Using
OCR Progress and Performance Tracking
using IronOcr;
using System;


var ocrTesseract = new IronTesseract();

ocrTesseract.OcrProgress += (_, ocrProgressEventsArgs) =>
{
    Console.WriteLine(ocrProgressEventsArgs.ProgressPercent + "%   " + ocrProgressEventsArgs.Duration.TotalSeconds + "s");
};

using (var input = new OcrInput("large.pdf"))
{
    // Progress events will fire during the read operation even if the main thread is blocked.
    var result = ocrTesseract.Read(input);
}
Imports IronOcr
Imports System


Private ocrTesseract = New IronTesseract()

Private ocrTesseract.OcrProgress += Sub(underscore, ocrProgressEventsArgs)
	Console.WriteLine(ocrProgressEventsArgs.ProgressPercent & "%   " & ocrProgressEventsArgs.Duration.TotalSeconds & "s")
End Sub

Using input = New OcrInput("large.pdf")
	' Progress events will fire during the read operation even if the main thread is blocked.
	Dim result = ocrTesseract.Read(input)
End Using
OCR for MultiPage TIFF Files
using IronOcr;
using System;

var ocrTesseract = new IronTesseract();

using (var ocrInput = new OcrInput())
{
    ocrInput.AddMultiFrameTiff("images/multiframe.tiff");

    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}
Imports IronOcr
Imports System

Private ocrTesseract = New IronTesseract()

Using ocrInput As New OcrInput()
	ocrInput.AddMultiFrameTiff("images/multiframe.tiff")

	Dim ocrResult = ocrTesseract.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using
Make any PDF have Searchable, Copyable Text
using IronOcr;

var ocrTesseract = new IronTesseract();

using (var ocrInput = new OcrInput())
{
    ocrInput.AddPdf("scan.pdf", "password");

    // Clean up twisted pages
    ocrInput.Deskew();

    var ocrResult = ocrTesseract.Read(ocrInput);
    ocrResult.SaveAsSearchablePdf("searchable.pdf");
}
Imports IronOcr

Private ocrTesseract = New IronTesseract()

Using ocrInput As New OcrInput()
	ocrInput.AddPdf("scan.pdf", "password")

	' Clean up twisted pages
	ocrInput.Deskew()

	Dim ocrResult = ocrTesseract.Read(ocrInput)
	ocrResult.SaveAsSearchablePdf("searchable.pdf")
End Using
Using Custom Tesseract Language Files
using IronOcr;
using System;


var ocrTesseract = new IronTesseract();

ocrTesseract.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");

using (var ocrInput = new OcrInput(@"images\image.png"))
{
    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
}
Imports IronOcr
Imports System


Private ocrTesseract = New IronTesseract()

ocrTesseract.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata")

Using ocrInput As New OcrInput("images\image.png")
	Dim ocrResult = ocrTesseract.Read(ocrInput)
	Console.WriteLine(ocrResult.Text)
End Using
Multiple Languages for 1 Document
//PM> Install-Package IronOcr.Languages.Arabic
//PM> Install-Package IronOcr.Languages.Chinese
using IronOcr;
using System;

var Ocr = new IronTesseract();

// Add a primary language (Default is English)
Ocr.Language = OcrLanguage.English;

// Add as many secondary languages as you like
Ocr.AddSecondaryLanguage(OcrLanguage.Arabic);
Ocr.AddSecondaryLanguage(OcrLanguage.ChineseSimplified);

using (var Input = new OcrInput(@"images\image.png"))
{
    var Result = Ocr.Read(Input);
    Console.WriteLine(Result.Text);
}
'PM> Install-Package IronOcr.Languages.Arabic
'PM> Install-Package IronOcr.Languages.Chinese
Imports IronOcr
Imports System

Private Ocr = New IronTesseract()

' Add a primary language (Default is English)
Ocr.Language = OcrLanguage.English

' Add as many secondary languages as you like
Ocr.AddSecondaryLanguage(OcrLanguage.Arabic)
Ocr.AddSecondaryLanguage(OcrLanguage.ChineseSimplified)

Using Input = New OcrInput("images\image.png")
	Dim Result = Ocr.Read(Input)
	Console.WriteLine(Result.Text)
End Using
Exporting Images of OCR Elements
using IronOcr;
using IronSoftware.Drawing;

var ocrTesseract = new IronTesseract();
using (var ocrInput = new OcrInput(@"images\image.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

Private ocrTesseract = New IronTesseract()
Using ocrInput As New OcrInput("images\image.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 word
	Next page
End Using
IronOCR
  1. IronOCR
  2. IronOCR Blog
  3. Case Studies

Case Studies

  • All Articles
  • OCR Tools
  • Compare to Other Components
  • Case Studies

December 6, 2022

SanSaTek Testimonial

Sangkar Sari Teknologi is an international consultancy who are based in both Holland and Indonesia.

Read More >

Ready to get started? Version: 2023.1 just released

Start for Free Total downloads: 633,508
View Licenses >
Try IronOCR for Free
Get Set Up in 5 Minutes
C# NuGet Library for PDF
Install with NuGet
Version: 2023.1
Install-Package IronOcr
nuget.org/packages/IronOcr/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronOCR"
  3. Select the package and install
C# PDF DLL
Download DLL
Version: 2023.1
Download Now
or download Windows Installer here.
  1. Download and unzip IronOCR to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronOCR.dll"
Licenses from $749

Have a question? Get in touch with our development team.

Now that you’ve downloaded IronOCR
Want to deploy IronOCR to a live project for FREE?
Not ready to buy?

Want to deploy IronOCR to a live project for FREE?

What’s included?
30 days of fully-functional product
Test and share in a live environment
No restrictions in production
Get your free 30-day Trial Key instantly.
Thank you.
If you'd like to speak to our licensing team:
Schedule a call
Have a question? Get in touch with our development team.
No credit card or account creation required
Your Trial License Key has been emailed to you.
Not ready to buy?
Thank you.
View your license options:
Thank you.
If you'd like to speak to our licensing team:
View Licensing
Schedule a call
Have a question? Get in touch with our development team.
Have a question? Get in touch with our development team.
Want to deploy IronOCR to a live project for FREE?
Not ready to buy?

Want to deploy IronOCR to a live project for FREE?

What’s included?
30 days of fully-functional product
Test and share in a live environment
No restrictions in production
Get your free 30-day Trial Key instantly.
Thank you.
If you'd like to speak to our licensing team:
Schedule a call
Have a question? Get in touch with our development team.
No credit card or account creation required
Your Trial License Key has been emailed to you.
Not ready to buy?
Download IronOCR free to apply
your Trial Licenses Key
Thank you.
If you'd like to speak to our licensing team:
Install with NuGet View Licensing
Schedule a call
Licenses from $749. Have a question? Get in touch.
Have a question? Get in touch with our development team.
Free 30-Day Trial Key

Fully-functional product, get the key instantly

IronOCR for .NET

Tesseract 5 OCR in the languages you need, We support 127+.

Search

Documentation

  • Code Examples
  • API Reference
  • How-Tos
  • Features
  • Credits
  • Blog
  • Product Brochure

Tutorials

  • Get Started
  • C# Image to Text
  • C# Tesseract OCR
  • OCR Image Filters
  • OCR with Computer Vision

Licensing

  • Buy a License
  • Support Extensions
  • Resellers
  • License Keys
  • EULA

Try IronOCR Free

  • Download on NuGet
  • Download DLL

  • Download Windows Installer

  • 30-Day Trial License

When you need your PDF to look like HTML, fast.

Tesseract 5 OCR in the languages you need, We support 127+.

When you need to read, write, and style, QR & Barcodes, fast.

The Excel API you need, without the Office Interop hassle.

The power you need to scrape & output clean, structured data.

The complete .NET Suite for your office.

  • IRONSUITE
  • |
  • IRONPDF
  • IRONOCR
  • IRONBARCODE
  • IRONXL
  • IRONWEBSCRAPER
IronSoftware
205 N. Michigan Ave. Chicago, IL 60611 USA +1 (312) 500-3060
  • About Us
  • News
  • Careers
  • Contact Us
  • Join Iron Slack

Supporting Teamseas

Copyright © Iron Software LLC 2013-2023

  • Terms
  • Privacy

Thank you!

Your license key has been delivered to the email provided. Contact us

24-Hour Upgrade Offer:

Save 50% on a
Professional Upgrade

Go Professional to cover 10 developers
and unlimited projects.

hours

:

minutes

:

seconds

Upgrade to Professional

Upgrade

Professional

$600 USD

$299 USD


  • 10 developers
  • 10 locations
  • 10 projects
TODAY ONLY
Iron Suite

5 .NET Products for the Price of 2

IronPDF IronOCR IronXL IronBarcode IronWebscraper

Total Suite Value:

$7,192 USD

Upgrade price

TODAY
ONLY

$499 USD

After 24 Hrs

$1,098 USD