超时
TimeoutMs提供了一个可选的超时时间,以毫秒为单位,超过此时间后,OCR读取操作将被取消。
与AbortToken类似,TimeoutMS也有助于在程序或应用程序运行时遇到停滞时读取大型输入文件。
请注意,该功能不支持 .NET Framework 4.x.x。
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.x.x。