超时
using IronOcr;

int cancel_time = 1000;

// Opens a Large PDF which may need to be cancelled early
IronTesseract ocrTesseract = new IronTesseract() { Language = OcrLanguage.English };
var ocrInput = new OcrInput();
ocrInput.LoadPdf("large-report.pdf");

// Starts a read on the PDF using IronOCR with specified cancel time
OcrReadTask ocrRead = ocrTesseract.ReadAsync(ocrInput, cancel_time);
ocrRead.Wait();
NuGet Download
PM > Install-Package IronOcr
超时

超时

TimeoutMs 提供一个可选的毫秒级超时,超过此时间将取消 OCR 读取操作。

与 AbortToken 类似,TimeoutMs 也帮助读取大型输入文件,以防程序或应用卡住。

请注意,.NET Framework 4.xx 不支持此功能。

探索使用 IronOCR 在 C# 中进行异步 OCR 处理
在 GitHub 上查看

准备开始了吗?

Nuget Downloads 6,337,990版本:2026.10刚刚发布