Indonesian 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 Indonesian. 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.Indonesian
This package contains 55 OCR languages for .NET:
- Indonesian
- IndonesianBest
- IndonesianFast
Download
Indonesian Language Pack [Bahasa Indonesia]
Installation
The first thing we have to do is install our Indonesian OCR package to your .NET project.
Install-Package IronOCR.Languages.Indonesian
Code Example
This C# code example reads Indonesian text from an Image or PDF document.
// Ensure the IronOCR package is installed:
// PM> Install-Package IronOcr.Languages.Indonesian
using IronOcr;
var Ocr = new IronTesseract();
// Set the OCR language to Indonesian
Ocr.Language = OcrLanguage.Indonesian;
// Use the OCR engine to read text from an image
using (var Input = new OcrInput(@"images\Indonesian.png"))
{
// Perform OCR on the given input
var Result = Ocr.Read(Input);
// Retrieve all recognized text
var AllText = Result.Text;
// Print the recognized text to the console
Console.WriteLine(AllText);
}
// Ensure the IronOCR package is installed:
// PM> Install-Package IronOcr.Languages.Indonesian
using IronOcr;
var Ocr = new IronTesseract();
// Set the OCR language to Indonesian
Ocr.Language = OcrLanguage.Indonesian;
// Use the OCR engine to read text from an image
using (var Input = new OcrInput(@"images\Indonesian.png"))
{
// Perform OCR on the given input
var Result = Ocr.Read(Input);
// Retrieve all recognized text
var AllText = Result.Text;
// Print the recognized text to the console
Console.WriteLine(AllText);
}
' Ensure the IronOCR package is installed:
' PM> Install-Package IronOcr.Languages.Indonesian
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the OCR language to Indonesian
Ocr.Language = OcrLanguage.Indonesian
' Use the OCR engine to read text from an image
Using Input = New OcrInput("images\Indonesian.png")
' Perform OCR on the given input
Dim Result = Ocr.Read(Input)
' Retrieve all recognized text
Dim AllText = Result.Text
' Print the recognized text to the console
Console.WriteLine(AllText)
End Using
- This script demonstrates how to use the IronTesseract OCR engine to read and recognize Indonesian text from an image.
- It uses the
OcrInput
class to specify the source image, and thenOcr.Read()
to process the image and extract text. - The recognized text is stored in the
AllText
variable and printed to the console.