Croatian OCR in C# and .NET

Other versions of this document:

IronOCR is a C# software component allowing .NET developers to read text from images and PDF documents in 126 languages, including Croatian. It is an advanced fork of Tesseract, built exclusively for .NET developers, and regularly outperforms other Tesseract engines in both speed and accuracy.

Contents of IronOcr.Languages.Croatian

This package contains support for 49 OCR languages for .NET, including:

  • Croatian
  • CroatianBest
  • CroatianFast

Download

Croatian Language Pack [hrvatski jezik]

Installation

The first step is to install the Croatian OCR package into your .NET project using NuGet.

Install-Package IronOCR.Languages.Croatian

Code Example

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

// Add the required namespace for IronOCR
using IronOcr;

class OCRExample
{
    public static void Main()
    {
        // Create a new IronTesseract instance
        var Ocr = new IronTesseract();

        // Set the OCR language to Croatian
        Ocr.Language = OcrLanguage.Croatian;

        // Define the input image or PDF containing Croatian text
        using (var Input = new OcrInput(@"images\Croatian.png"))
        {
            // Perform OCR on the input
            var Result = Ocr.Read(Input);

            // Extract all recognized text
            var AllText = Result.Text;

            // Output the recognized text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
// Add the required namespace for IronOCR
using IronOcr;

class OCRExample
{
    public static void Main()
    {
        // Create a new IronTesseract instance
        var Ocr = new IronTesseract();

        // Set the OCR language to Croatian
        Ocr.Language = OcrLanguage.Croatian;

        // Define the input image or PDF containing Croatian text
        using (var Input = new OcrInput(@"images\Croatian.png"))
        {
            // Perform OCR on the input
            var Result = Ocr.Read(Input);

            // Extract all recognized text
            var AllText = Result.Text;

            // Output the recognized text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
' Add the required namespace for IronOCR
Imports IronOcr

Friend Class OCRExample
	Public Shared Sub Main()
		' Create a new IronTesseract instance
		Dim Ocr = New IronTesseract()

		' Set the OCR language to Croatian
		Ocr.Language = OcrLanguage.Croatian

		' Define the input image or PDF containing Croatian text
		Using Input = New OcrInput("images\Croatian.png")
			' Perform OCR on the input
			Dim Result = Ocr.Read(Input)

			' Extract all recognized text
			Dim AllText = Result.Text

			' Output the recognized text to the console
			System.Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

Explanation

  • IronTesseract: This is the main class used to perform OCR operations. It reads text from images or PDFs and supports multiple languages.
  • OcrInput: Represents the input source for OCR, which can be an image or PDF file.
  • Ocr.Read: Executes the OCR process on the specified input.
  • Result.Text: Contains the extracted text from the input, which is then printed to the console.