C# 和 .NET 中的南非荷兰语 OCR
Curtis Chau
更新: 2026年8月2日
本文档的其他版本:
IronOCR 是一个 C# 软件组件,允许 .NET 程序员从图像和 PDF 文档中读取 126 种语言(包括南非荷兰语)的文本。
它是 Tesseract 的一个高级分支,专为 .NET 开发人员构建,在速度和准确性方面通常优于其他 Tesseract 引擎。
IronOcr.Languages.Afrikaans 的内容
此软件包包含 52 种适用于 .NET 的 OCR 语言:
- Afrikaans
- AfrikaansBest
- AfrikaansFast
下载
南非荷兰语语言包[南非荷兰语]
安装
我们首先需要做的就是将我们的南非语OCR 包安装到您的 .NET 项目中。
代码示例
此 C# 代码示例从图像或 PDF 文档中读取南非荷兰语文本。
// First, ensure the IronOcr.Languages.Afrikaans package is installed in your project.
// This example requires the IronOcr C# package to read text from images or PDFs.
using IronOcr;
var Ocr = new IronTesseract(); // Initialize the IronTesseract class
Ocr.Language = OcrLanguage.Afrikaans; // Set the language to Afrikaans
// Load the image or PDF document into an OcrInput object
using (var Input = new OcrInput(@"images\Afrikaans.png"))
{
// Perform OCR on the input document
var Result = Ocr.Read(Input);
// Retrieve the complete recognized text
var AllText = Result.Text;
// Output the recognized text (this step is customizable for your use-case)
Console.WriteLine(AllText);
}' First, ensure the IronOcr.Languages.Afrikaans package is installed in your project.
' This example requires the IronOcr VB.NET package to read text from images or PDFs.
Imports IronOcr
Dim Ocr = New IronTesseract() ' Initialize the IronTesseract class
Ocr.Language = OcrLanguage.Afrikaans ' Set the language to Afrikaans
' Load the image or PDF document into an OcrInput object
Using Input = New OcrInput("images\Afrikaans.png")
' Perform OCR on the input document
Dim Result = Ocr.Read(Input)
' Retrieve the complete recognized text
Dim AllText = Result.Text
' Output the recognized text (this step is customizable for your use-case)
Console.WriteLine(AllText)
End Using' First, ensure the IronOcr.Languages.Afrikaans package is installed in your project.
' This example requires the IronOcr VB.NET package to read text from images or PDFs.
Imports IronOcr
Dim Ocr = New IronTesseract() ' Initialize the IronTesseract class
Ocr.Language = OcrLanguage.Afrikaans ' Set the language to Afrikaans
' Load the image or PDF document into an OcrInput object
Using Input = New OcrInput("images\Afrikaans.png")
' Perform OCR on the input document
Dim Result = Ocr.Read(Input)
' Retrieve the complete recognized text
Dim AllText = Result.Text
' Output the recognized text (this step is customizable for your use-case)
Console.WriteLine(AllText)
End Using说明:
- IronTesseract: 此类是IronOCR库的一部分,用于设置OCR过程。
- OcrLanguage: 此属性设置OCR的语言。 这里设置的是南非荷兰语。
- OcrInput: 此类包含OCR过程的输入文件。 它支持多种图像格式和PDF文件。
Ocr.Read(): 此方法执行OCR过程并返回包含识别文本的结果对象。- Result.Text: 此属性包含从输入文档提取的文本。
Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。