Persian OCR in C# and .NET

Curtis Chau
Curtis Chau
Updated: August 2, 2026
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 Persian.

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.Persian

This package contains 46 OCR languages for .NET:

  • Persian
  • PersianBest
  • PersianFast

Download

Persian Language Pack [فارسی]

Installation

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

PM> Install-Package IronOcr.Languages.Persian

Code Example

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

// Install IronOcr.Languages.Persian package using NuGet Package Manager
// PM> Install-Package IronOcr.Languages.Persian

using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of IronTesseract
        var Ocr = new IronTesseract();
        
        // Set the language to Persian
        Ocr.Language = OcrLanguage.Persian;

        // Load input image or PDF file
        using (var Input = new OcrInput(@"images\Persian.png"))
        {
            // Perform OCR to read text from the image
            var Result = Ocr.Read(Input);

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

            // Display the extracted text
            Console.WriteLine(AllText);
        }
    }
}

The above code example demonstrates how to utilize the IronOCR library to perform OCR on a Persian image. It's essential to have the Persian language pack installed, and the path to the image should be specified correctly. The OCR operation is performed within a using statement to ensure proper disposal of resources.

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

Read More

Ready to Get Started?

Nuget Downloads 6,357,159Version:2026.11just released