Polish OCR in C# and .NET

Other versions of this document:

IronOCR is a C# software component that allows .NET developers to read text from images and PDF documents in 126 languages, including Polish. 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.Polish

This package contains 43 OCR languages for .NET:

  • Polish
  • PolishBest
  • PolishFast

Download

Polish Language Pack [język polski]:

Installation

The first thing to do is to install the Polish OCR package into your .NET project.

To install using NuGet Package Manager, execute the following command:

Install-Package IronOCR.Languages.Polish

Code Example

This C# code example demonstrates how to read Polish text from an image or a PDF document using IronOCR.

// Install the IronOcr.Languages.Polish package via NuGet before using this code.
using IronOcr;

public class PolishOcrExample
{
    public void ReadPolishTextFromImage()
    {
        // Initialize the IronTesseract object
        var Ocr = new IronTesseract();

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

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

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

            // Display or process the recognized text
            Console.WriteLine(AllText);
        }
    }
}
// Install the IronOcr.Languages.Polish package via NuGet before using this code.
using IronOcr;

public class PolishOcrExample
{
    public void ReadPolishTextFromImage()
    {
        // Initialize the IronTesseract object
        var Ocr = new IronTesseract();

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

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

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

            // Display or process the recognized text
            Console.WriteLine(AllText);
        }
    }
}
' Install the IronOcr.Languages.Polish package via NuGet before using this code.
Imports IronOcr

Public Class PolishOcrExample
	Public Sub ReadPolishTextFromImage()
		' Initialize the IronTesseract object
		Dim Ocr = New IronTesseract()

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

		' Provide the path to the image or PDF file containing Polish text
		Using Input = New OcrInput("images\Polish.png")
			' Perform OCR on the input image
			Dim Result = Ocr.Read(Input)

			' Extract all recognized text
			Dim AllText = Result.Text

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

This script initializes the OCR engine, specifies the language (Polish), and processes the image located at "images\Polish.png" to extract and display the text. Ensure that the file path is correct and that the OCR package is installed prior to running the code.