Using Custom OCR Language Packs with IronOCR

This article was translated from English: Does it need improvement?
Translated
View the article in English

How to create custom language packs for use in IronOCR?

Creating a custom language pack requires training a new Tesseract 4 LSTM language file/dictionary from a font.

There are many tutorials available online explaining the steps required to do this. The process is not simple, but it is thankfully quite well-documented.

As a good place to start, we suggest this YouTube tutorial from Gabriel Garcia (no affiliation) and their linked GitHub repository.

Once complete, the output will be a .traineddata file.

The .traineddata file can then be referenced in IronOCR as follows:

Documentation: IronOCR Custom Languages

using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Load your custom Tesseract language file (trained .traineddata file)
        Ocr.UseCustomTesseractLanguageFile("mydir/custom.traineddata");  //<--- your new font

        // Multiple fonts can be used by calling the method multiple times with different files

        // Load an image into the OCR Input for processing
        using (var Input = new OcrInput(@"images\image.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Output the recognized text to the console
            Console.WriteLine(Result.Text);
        }
    }
}
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Load your custom Tesseract language file (trained .traineddata file)
        Ocr.UseCustomTesseractLanguageFile("mydir/custom.traineddata");  //<--- your new font

        // Multiple fonts can be used by calling the method multiple times with different files

        // Load an image into the OCR Input for processing
        using (var Input = new OcrInput(@"images\image.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Output the recognized text to the console
            Console.WriteLine(Result.Text);
        }
    }
}
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Initialize the IronTesseract OCR engine
		Dim Ocr = New IronTesseract()

		' Load your custom Tesseract language file (trained .traineddata file)
		Ocr.UseCustomTesseractLanguageFile("mydir/custom.traineddata") '<--- your new font

		' Multiple fonts can be used by calling the method multiple times with different files

		' Load an image into the OCR Input for processing
		Using Input = New OcrInput("images\image.png")
			' Perform OCR on the input image
			Dim Result = Ocr.Read(Input)

			' Output the recognized text to the console
			Console.WriteLine(Result.Text)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
Curtis Chau
Escritor Técnico

Curtis Chau tiene una licenciatura en Ciencias de la Computación (Carleton University) y se especializa en el desarrollo front-end con experiencia en Node.js, TypeScript, JavaScript y React. Apasionado por crear interfaces de usuario intuitivas y estéticamente agradables, disfruta trabajando con frameworks modernos y creando manuales bien ...

Leer más
¿Listo para empezar?
Nuget Descargas 5,044,537 | Versión: 2025.11 recién lanzado