C# 與 .NET 中的克羅埃西亞語 OCR
Curtis Chau
已更新: 2026年8月2日
本文檔的其他版本:
IronOCR 是一個 C# 軟體元件,允許 .NET 開發人員從圖像和 PDF 文件中讀取 126 種語言(包括克羅埃西亞語)的文字。 它是 Tesseract 的一個高級分支,專為 .NET 開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。
IronOcr.Languages.Croatian 的內容
此軟體包包含對 49 種 .NET OCR 語言的支援,其中包括:
- Croatian
- CroatianBest
- CroatianFast
下載
克羅埃西亞語語言包[克羅埃西亞語]
安裝
第一步是使用 NuGet 將克羅埃西亞語OCR 套件安裝到您的 .NET 專案中。
程式碼範例
這段 C# 程式碼範例從圖像或 PDF 文件中讀取克羅埃西亞語文字。
// Add the required namespace for IronOCR
using IronOcr;
class OCRExample
{
public static void Main()
{
// Create a new IronTesseract instance
var Ocr = new IronTesseract();
// Set the OCR language to Croatian
Ocr.Language = OcrLanguage.Croatian;
// Define the input image or PDF containing Croatian text
using (var Input = new OcrInput(@"images\Croatian.png"))
{
// Perform OCR on the input
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output the recognized text to the console
System.Console.WriteLine(AllText);
}
}
}' Add the required namespace for IronOCR
Imports IronOcr
Friend Class OCRExample
Public Shared Sub Main()
' Create a new IronTesseract instance
Dim Ocr = New IronTesseract()
' Set the OCR language to Croatian
Ocr.Language = OcrLanguage.Croatian
' Define the input image or PDF containing Croatian text
Using Input = New OcrInput("images\Croatian.png")
' Perform OCR on the input
Dim Result = Ocr.Read(Input)
' Extract all recognized text
Dim AllText = Result.Text
' Output the recognized text to the console
System.Console.WriteLine(AllText)
End Using
End Sub
End Class' Add the required namespace for IronOCR
Imports IronOcr
Friend Class OCRExample
Public Shared Sub Main()
' Create a new IronTesseract instance
Dim Ocr = New IronTesseract()
' Set the OCR language to Croatian
Ocr.Language = OcrLanguage.Croatian
' Define the input image or PDF containing Croatian text
Using Input = New OcrInput("images\Croatian.png")
' Perform OCR on the input
Dim Result = Ocr.Read(Input)
' Extract all recognized text
Dim AllText = Result.Text
' Output the recognized text to the console
System.Console.WriteLine(AllText)
End Using
End Sub
End Class說明
- IronTesseract: 這是用來執行OCR操作的主要類別。 它可以讀取圖像或 PDF 中的文字,並支援多種語言。
- OcrInput: 表示OCR的輸入來源,可以是影像或PDF文件。
- Ocr.Read: 在指定的輸入上執行OCR過程。
- Result.Text: 包含從輸入中提取的文字,然後列印到控制台。
Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。