Test in production without watermarks.
Works wherever you need it to.
Get 30 days of fully functional product.
Have it up and running in minutes.
Full access to our support engineering team during your product trial
In this tutorial, we explore the implementation of Optical Character Recognition (OCR) using IronOCR in Windows 11 with Visual Studio 2022. The process begins with setting up the environment, including the installation of IronOCR via NuGet Package Manager. The tutorial walks you through the coding process, starting from instantiating Iron Tesseract to creating an OCR object.
We then create an instance of OCR input, which is managed efficiently with a using
statement to ensure automatic disposal after use. Images are added using the AddImage
method, ready for OCR processing. By employing the Read
method, we extract text from the images, storing the results in the result
object. The extracted text is then displayed on the console, demonstrating the almost perfect accuracy of IronOCR.
The tutorial emphasizes IronOCR's impressive capabilities and versatility, supporting both Windows 11 and Windows 10. Additionally, viewers are encouraged to explore Iron Software's 30-day trial to experience these powerful features firsthand. This guide not only showcases the ease of executing OCR operations but also highlights the robust performance of IronOCR, making it an invaluable tool for developers.
using System;
using IronOcr;
class Program
{
static void Main()
{
// Instantiate the IronTesseract class, which is the engine for OCR
var Ocr = new IronTesseract();
// Using statement ensures that resources are released when done
using (var Input = new OcrInput())
{
// Add an image for processing
Input.AddImage("path_to_your_image_file");
// Perform OCR on the input images
var Result = Ocr.Read(Input);
// Output the text extracted from the image to the console
Console.WriteLine(Result.Text);
}
}
}
using System;
using IronOcr;
class Program
{
static void Main()
{
// Instantiate the IronTesseract class, which is the engine for OCR
var Ocr = new IronTesseract();
// Using statement ensures that resources are released when done
using (var Input = new OcrInput())
{
// Add an image for processing
Input.AddImage("path_to_your_image_file");
// Perform OCR on the input images
var Result = Ocr.Read(Input);
// Output the text extracted from the image to the console
Console.WriteLine(Result.Text);
}
}
}
Imports System
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Instantiate the IronTesseract class, which is the engine for OCR
Dim Ocr = New IronTesseract()
' Using statement ensures that resources are released when done
Using Input = New OcrInput()
' Add an image for processing
Input.AddImage("path_to_your_image_file")
' Perform OCR on the input images
Dim Result = Ocr.Read(Input)
' Output the text extracted from the image to the console
Console.WriteLine(Result.Text)
End Using
End Sub
End Class
Further Reading: How to use OCR with C# on Windows 11