Hebrew 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 Hebrew.
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.Hebrew
This package contains 108 OCR languages for .NET:
- Hebrew
- HebrewBest
- HebrewFast
- HebrewAlphabet
- HebrewAlphabetBest
- HebrewAlphabetFast
Download
Hebrew Language Pack [עברית]
Installation
The first thing we have to do is install our Hebrew OCR package to your .NET project.
Install-Package IronOCR.Languages.Hebrew
Code Example
This C# code example reads Hebrew text from an Image or PDF document.
// Include the IronOcr namespace to work with OCR features
using IronOcr;
// Create an OCR engine
var Ocr = new IronTesseract();
// Set the OCR engine language to Hebrew
Ocr.Language = OcrLanguage.Hebrew;
// Process the image and extract text using OCR
using (var Input = new OcrInput(@"images\Hebrew.png"))
{
// Read the text from the input image
var Result = Ocr.Read(Input);
// Store the extracted text
var AllText = Result.Text;
// Output the extracted text to the console (optional)
Console.WriteLine(AllText);
}
// Include the IronOcr namespace to work with OCR features
using IronOcr;
// Create an OCR engine
var Ocr = new IronTesseract();
// Set the OCR engine language to Hebrew
Ocr.Language = OcrLanguage.Hebrew;
// Process the image and extract text using OCR
using (var Input = new OcrInput(@"images\Hebrew.png"))
{
// Read the text from the input image
var Result = Ocr.Read(Input);
// Store the extracted text
var AllText = Result.Text;
// Output the extracted text to the console (optional)
Console.WriteLine(AllText);
}
' Include the IronOcr namespace to work with OCR features
Imports IronOcr
' Create an OCR engine
Private Ocr = New IronTesseract()
' Set the OCR engine language to Hebrew
Ocr.Language = OcrLanguage.Hebrew
' Process the image and extract text using OCR
Using Input = New OcrInput("images\Hebrew.png")
' Read the text from the input image
Dim Result = Ocr.Read(Input)
' Store the extracted text
Dim AllText = Result.Text
' Output the extracted text to the console (optional)
Console.WriteLine(AllText)
End Using
- IronTesseract: This class is used to initialize the OCR engine.
- OcrInput: This represents the input image or document the OCR engine will read.
- Ocr.Read: This method processes the input and returns the result containing the extracted text.
- Result.Text: Stores the extracted text which can be used for further processing.