Bulgarian OCR in C# and .NET
This article was translated from English: Does it need improvement?
Translated
View the article in English
本文件的其他版本:
IronOCR 是一個 C# 軟體元件,讓 .NET 開發人員能夠從 126 種語言(包括保加利亞語)的圖片和 PDF 文件中讀取文字。
這是 Tesseract 的進階分支版本,專為 .NET 開發者打造,無論在速度或準確度方面,其表現均定期超越其他 Tesseract 引擎。
IronOcr.Languages.Bulgarian 內容
此套件包含 52 種適用於 .NET 的 OCR 語言:
- 保加利亞語
- 保加利亞語最佳
- 保加利亞語Fast
下載
保加利亞語語言套件 [български език]
安裝
我們首先必須將保加利亞語 OCR 套件安裝至您的 .NET 專案中。
Install-Package IronOcr.Languages.Bulgarian
程式碼範例
此 C# 程式碼範例用於從圖片或 PDF 文件中讀取保加利亞語文字。
// Ensure you have installed the IronOCR language package for Bulgarian
// PM> Install-Package IronOcr.Languages.Bulgarian
using IronOcr;
var Ocr = new IronTesseract();
// Set the OCR language to Bulgarian
Ocr.Language = OcrLanguage.Bulgarian;
// Load the image or PDF document containing Bulgarian text
using (var Input = new OcrInput(@"images\Bulgarian.png"))
{
// Perform OCR and obtain the result
var Result = Ocr.Read(Input);
// Extract all the text from the OCR result
var AllText = Result.Text;
// Optionally, print or use the extracted text as needed
Console.WriteLine(AllText);
}
// Ensure you have installed the IronOCR language package for Bulgarian
// PM> Install-Package IronOcr.Languages.Bulgarian
using IronOcr;
var Ocr = new IronTesseract();
// Set the OCR language to Bulgarian
Ocr.Language = OcrLanguage.Bulgarian;
// Load the image or PDF document containing Bulgarian text
using (var Input = new OcrInput(@"images\Bulgarian.png"))
{
// Perform OCR and obtain the result
var Result = Ocr.Read(Input);
// Extract all the text from the OCR result
var AllText = Result.Text;
// Optionally, print or use the extracted text as needed
Console.WriteLine(AllText);
}
' Ensure you have installed the IronOCR language package for Bulgarian
' PM> Install-Package IronOcr.Languages.Bulgarian
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the OCR language to Bulgarian
Ocr.Language = OcrLanguage.Bulgarian
' Load the image or PDF document containing Bulgarian text
Using Input = New OcrInput("images\Bulgarian.png")
' Perform OCR and obtain the result
Dim Result = Ocr.Read(Input)
' Extract all the text from the OCR result
Dim AllText = Result.Text
' Optionally, print or use the extracted text as needed
Console.WriteLine(AllText)
End Using
$vbLabelText
$csharpLabel
在此範例中:
- 我們建立一個
IronTesseract物件來執行 OCR 操作。 - 我們使用
OcrLanguage.Bulgarian將 OCR 的語言設定為保加利亞語。 - 我們將影像檔案
Bulgarian.png載入至OcrInput物件中。 - 我們使用
Ocr.Read(Input)從圖片中提取文字。 - 最後,可透過
Result.Text存取擷取的文字。

