OCR in 1 line of code

IronOCR is unique in its ability to automatically detect and read text from imperfectly scanned images and PDF documents. The IronTesseract class provides the simplest API.

Try other code samples to gain fine-grained control of your C# OCR operations.

IronOCR provides the most advanced build of Tesseract known anywhere, on any platform, with increased speed, accuracy, and a native DLL and API.

Supports Tesseract 3, Tesseract 4, and Tesseract 5 for .NET Framework, Standard, Core, Xamarin, and Mono.

Imports IronOcr

' Instantiate the IronTesseract class to create a new OCR reader
Dim Ocr As New IronTesseract()

' Load an image or PDF document from which to extract the text
Dim Result = Ocr.Read("example_document.png")

' Output the extracted text from the OCR result onto the console
Console.WriteLine(Result.Text)
Imports IronOcr

' Instantiate the IronTesseract class to create a new OCR reader
Dim Ocr As New IronTesseract()

' Load an image or PDF document from which to extract the text
Dim Result = Ocr.Read("example_document.png")

' Output the extracted text from the OCR result onto the console
Console.WriteLine(Result.Text)
VB .NET

Detailed Explanation:

  1. Instantiate IronTesseract: This step initializes an IronTesseract object which allows us to perform OCR operations. It provides the methods needed to read and extract text from images or documents.

  2. Load and Read the Document: The Read method performs OCR on the provided file. In this example, it processes "example_document.png". This operation extracts text content from the image.

  3. Output the Extracted Text: The result of the Read method contains a property Text, which holds the extracted text. This text is printed to the console using Console.WriteLine.

By following these steps, you can easily perform OCR in VB.NET using the IronOCR library, allowing the automation of text extraction for various applications.