Macedonian OCR in C# and .NET

Other versions of this document:

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

Contents of IronOcr.Languages.Macedonian

This package contains 55 OCR languages for .NET:

  • Macedonian
  • MacedonianBest
  • MacedonianFast

Download

Macedonian Language Pack [македонски јазик]

Installation

The first thing we have to do is install our Macedonian OCR package to your .NET project.

Install-Package IronOCR.Languages.Macedonian

Code Example

This C# code example reads Macedonian text from an Image or PDF document.

// Using IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Create an instance of IronTesseract
        var Ocr = new IronTesseract();

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

        // Using OcrInput to load an image
        using (var Input = new OcrInput(@"images\Macedonian.png"))
        {
            // Perform OCR on the input
            var Result = Ocr.Read(Input);

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

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

class Program
{
    static void Main()
    {
        // Create an instance of IronTesseract
        var Ocr = new IronTesseract();

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

        // Using OcrInput to load an image
        using (var Input = new OcrInput(@"images\Macedonian.png"))
        {
            // Perform OCR on the input
            var Result = Ocr.Read(Input);

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

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

Friend Class Program
	Shared Sub Main()
		' Create an instance of IronTesseract
		Dim Ocr = New IronTesseract()

		' Set the language for OCR to Macedonian
		Ocr.Language = OcrLanguage.Macedonian

		' Using OcrInput to load an image
		Using Input = New OcrInput("images\Macedonian.png")
			' Perform OCR on the input
			Dim Result = Ocr.Read(Input)

			' Get the recognized text
			Dim AllText = Result.Text

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

Explanation:

  • IronTesseract: This is a class from the IronOCR library which provides functionality to perform OCR operations.
  • OcrInput: This class is used to specify the image or PDF file from which text needs to be extracted.
  • Ocr.Read(): This method performs the OCR process on the given input and returns the result which includes recognized text.

To run this code, make sure you have the IronOCR library installed and the Macedonian language package loaded in your project.