English OCR in C# and .NET

126 More Languages

IronOCR is a C# software component allowing .NET coders to read text from images and PDF documents in 126 languages, including English.

It is an advanced fork of Tesseract, built exclusively for the .NET developers and regularly outperforms other Tesseract engines for both speed and accuracy.

Contents of IronOcr.Languages.English

This package contains 64 OCR languages for .NET:

Download

English Language Pack [Modern English]

Code Example

This C# code example reads English text from an image or PDF document.

// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Set the language to English
        Ocr.Language = OcrLanguage.English;

        // Define the input source as an image file
        using (var Input = new OcrInput(@"images\English.png"))
        {
            // Perform OCR to read the text from the input
            var Result = Ocr.Read(Input);

            // Get all the recognized text
            var AllText = Result.Text;

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Set the language to English
        Ocr.Language = OcrLanguage.English;

        // Define the input source as an image file
        using (var Input = new OcrInput(@"images\English.png"))
        {
            // Perform OCR to read the text from the input
            var Result = Ocr.Read(Input);

            // Get all the recognized text
            var AllText = Result.Text;

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
Imports IronOcr

Class Program
    Shared Sub Main()
        ' Initialize the IronTesseract OCR engine
        Dim Ocr As New IronTesseract()

        ' Set the language to English
        Ocr.Language = OcrLanguage.English

        ' Define the input source as an image file
        Using Input As New OcrInput("images\English.png")
            ' Perform OCR to read the text from the input
            Dim Result = Ocr.Read(Input)

            ' Get all the recognized text
            Dim AllText = Result.Text

            ' Output the recognized text
            Console.WriteLine(AllText)
        End Using
    End Sub
End Class
$vbLabelText   $csharpLabel
  • Ensure you have the IronOCR package and the appropriate language pack installed.
  • This example initializes the OCR engine, sets it to process English, reads text from an input image, and outputs the recognized text.