Romanian 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 Romanian. 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.Romanian
This package contains 49 OCR languages for .NET:
- Romanian
- RomanianBest
- RomanianFast
Download
Romanian Language Pack [limba română]
Installation
The first thing we have to do is install our Romanian OCR package to your .NET project.
Install-Package IronOCR.Languages.Romanian
Code Example
This C# code example reads Romanian text from an image or PDF document.
// Ensure you have installed the Romanian OCR package using the following NuGet command:
// PM> Install-Package IronOCR.Languages.Romanian
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Romanian;
using (var Input = new OcrInput(@"images\Romanian.png"))
{
// Perform OCR on the input image, and store the result
var Result = Ocr.Read(Input);
// Extract all recognized text from the OCR result
var AllText = Result.Text;
// Display the recognized text
Console.WriteLine(AllText);
}
// Ensure you have installed the Romanian OCR package using the following NuGet command:
// PM> Install-Package IronOCR.Languages.Romanian
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Romanian;
using (var Input = new OcrInput(@"images\Romanian.png"))
{
// Perform OCR on the input image, and store the result
var Result = Ocr.Read(Input);
// Extract all recognized text from the OCR result
var AllText = Result.Text;
// Display the recognized text
Console.WriteLine(AllText);
}
' Ensure you have installed the Romanian OCR package using the following NuGet command:
' PM> Install-Package IronOCR.Languages.Romanian
Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Romanian
Using Input = New OcrInput("images\Romanian.png")
' Perform OCR on the input image, and store the result
Dim Result = Ocr.Read(Input)
' Extract all recognized text from the OCR result
Dim AllText = Result.Text
' Display the recognized text
Console.WriteLine(AllText)
End Using
The above code demonstrates how to set up IronOCR to read text in Romanian from an image file. IronTesseract()
initializes a new OCR engine instance, and OcrInput()
loads the image for processing. The Read()
method performs the OCR operation. Finally, the recognized text is stored in the AllText
variable, which is then printed to the console. Remember to replace "images\Romanian.png"
with the path to your image file.