Latin Alphabet OCR in C# and .NET

Curtis Chau
Curtis Chau
Updated: 2026年4月23日

126 種其他語言

IronOCR 是一款 C# 軟體元件,讓 .NET 開發人員能夠從 126 種語言(包含拉丁字母)的圖片及 PDF 文件中讀取文字。

這是 Tesseract 的進階分支版本,專為 .NET 開發者打造,無論在速度或準確度方面,其表現均經常優於其他 Tesseract 引擎。

IronOcr.Languages.LatinAlphabet 的內容

此套件包含 64 種適用於 .NET 的 OCR 語言:

  • 拉丁字母
  • 拉丁字母Best
  • 拉丁字母Fast

下載

拉丁字母語言套件 [latine]

安裝

我們首先必須將拉丁字母 OCR 套件安裝至您的 .NET 專案中。

PM > Install-Package IronOcr.Languages.LatinAlphabet

程式碼範例

此 C# 程式碼範例用於從圖片或 PDF 文件中讀取拉丁字母文字。

// Install the IronOCR.languages.LatinAlphabet package first
using IronOcr;

var Ocr = new IronTesseract(); // Initialize IronTesseract instance

// Set the OCR language to LatinAlphabet
Ocr.Language = OcrLanguage.LatinAlphabet;

// Define the input image or PDF you want to read
using (var Input = new OcrInput(@"images\LatinAlphabet.png"))
{
    // Perform OCR reading on the input
    var Result = Ocr.Read(Input);
    
    // Extract the recognized text
    var AllText = Result.Text;

    // Output the recognized text
    Console.WriteLine(AllText);
}

說明

  1. IronTesseract 初始化:初始化 IronTesseract 的實例,該實例將負責處理 OCR 作業。

  2. 語言設定:OCR 語言設定為 LatinAlphabet,此為 IronOCR 套件中可用的語言之一。

  3. 輸入規格:建立一個 OcrInput 物件,指定要從中擷取文字的圖片或 PDF 檔案路徑。

  4. OCR 執行:呼叫 IronTesseract 實例的 Read 方法來處理 OcrInput。 這會返回一個 Result 物件,其中包含已擷取的文字。

  5. 文字擷取:Text 物件的 Result 屬性用於存取已識別的文字。

  6. 輸出:識別出的文字將輸出至控制台以供驗證。

請確保 OcrInput 中的檔案路徑正確指向您的圖片或 PDF 檔案,以避免發生檔案未找到的例外狀況。

Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。

閱讀更多

準備開始了嗎?

Nuget Downloads 6,357,159版本:2026.11剛剛發布