Persian 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 language, including Persian.
It is an advanced fork of Tesseract, built exclusively for the .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.
//PM> Install-Package IronOcr.Languages.Persian
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Persian;
using (var Input = new OcrInput(@"images\Persian.png"))
{
var Result = Ocr.Read(Input);
var AllText = Result.Text;
}
//PM> Install-Package IronOcr.Languages.Persian
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Persian;
using (var Input = new OcrInput(@"images\Persian.png"))
{
var Result = Ocr.Read(Input);
var AllText = Result.Text;
}
'PM> Install-Package IronOcr.Languages.Persian
Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Persian
Using Input = New OcrInput("images\Persian.png")
Dim Result = Ocr.Read(Input)
Dim AllText = Result.Text
End Using