文档阅读

使用IronOCR准确提取发票和报告中的文本和数据,并更快地构建功能。

文档阅读

1

阅读扫描文档

将物理文档和基于图像的 PDF 准确数字化为机器可读文本。非常适合创建可搜索的档案、自动输入纸质表格中的数据,以及使扫描内容可访问和可索引。我们的引擎擅长处理常见的扫描瑕疵。

了解如何:在 C# 中使用读取扫描文档

阅读发票文件

using IronOcr;

// Instantiate OCR engine
var ocr = new IronTesseract();

// Enable table detection
ocr.Configuration.ReadDataTables = true;
using var input = new OcrPdfInput("sample.pdf");
var result = ocr.Read(input);

// Retrieve the data
var table = result.Tables[0].DataTable;

// Print the retrieved item to the console
Console.WriteLine($"The first item in the table is: {result.Tables[0].DataTable.Rows[0][0]}");

读取照片

using IronOcr;

var ocr = new IronTesseract();
using var inputPhoto = new OcrInput();
inputPhoto.LoadImageFrame("ocr.tiff", 0);

// Read photo
OcrPhotoResult result = ocr.ReadPhoto(inputPhoto);

// Extract the text in the first region
string textinregion = result.TextRegions[0].TextInRegion;

// Print the text in the first region 
Console.WriteLine($"Full Scnned Photo Text: {textinregion}");
4

阅读截图

即时捕捉和处理应用程序窗口、用户界面或网页内容中的屏幕文本。通过读取其他应用程序的用户界面元素,实现与这些应用程序的无缝集成。

了解如何:在 C# 中使用读取屏幕截图
using IronOcr;
using System;
using System.Linq;

// Instantiate OCR engine
var ocr = new IronTesseract();
using var inputScreenshot = new OcrInput();
inputScreenshot.LoadImage("screenshotOCR.png");

// Perform OCR
OcrPhotoResult result = ocr.ReadScreenShot(inputScreenshot);

// Output screenshot information
Console.WriteLine(result.Text);

准备开始了吗?

Nuget Downloads 6,357,159版本:2026.11刚刚发布