超时
TimeoutMs提供了一个可选的超时(毫秒),超时后将取消OCR读取操作。
与AbortToken类似, TimeoutMs也有助于读取大型输入文件,以防程序或应用程序卡住。
请注意,.NET Framework 4.xx 不支持此功能。
准备开始了吗?
Nuget 下载 5,246,844 | 版本: 2025.12 刚刚发布
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();Imports IronOcr
Private cancel_time As Integer = 1000
' Opens a Large PDF which may need to be cancelled early
Private ocrTesseract As New IronTesseract() With {.Language = OcrLanguage.English}
Private ocrInput = New OcrInput()
ocrInput.LoadPdf("large-report.pdf")
' Starts a read on the PDF using IronOCR with specified cancel time
Dim ocrRead As OcrReadTask = ocrTesseract.ReadAsync(ocrInput, cancel_time)
ocrRead.Wait()Install-Package IronOcr
TimeoutMs提供了一个可选的超时(毫秒),超时后将取消OCR读取操作。
与AbortToken类似, TimeoutMs也有助于读取大型输入文件,以防程序或应用程序卡住。
请注意,.NET Framework 4.xx 不支持此功能。