在 ReadAsync 方法中,毫秒超時參數提供一個可選的超時設定(以毫秒為單位),在超過此時間後,OCR 讀取操作將被取消。
與使用 CancellationToken 類似,ReadAsync 超時參數也有助於在程式或應用程式卡住的情況下讀取大型輸入檔案。
請注意,.NET Framework 4.xx 不支援此功能。
探索使用 IronOCR 在 C# 中進行非同步 OCR 處理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
Dim cancel_time As Integer = 1000
' Opens a Large PDF which may need to be cancelled early
Dim ocrTesseract As New IronTesseract() With {.Language = OcrLanguage.English}
Dim 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()Imports IronOcr
Dim cancel_time As Integer = 1000
' Opens a Large PDF which may need to be cancelled early
Dim ocrTesseract As New IronTesseract() With {.Language = OcrLanguage.English}
Dim 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()在 ReadAsync 方法中,毫秒超時參數提供一個可選的超時設定(以毫秒為單位),在超過此時間後,OCR 讀取操作將被取消。
與使用 CancellationToken 類似,ReadAsync 超時參數也有助於在程式或應用程式卡住的情況下讀取大型輸入檔案。
請注意,.NET Framework 4.xx 不支援此功能。
探索使用 IronOCR 在 C# 中進行非同步 OCR 處理NuGet 下載次數 6,411,693|版本:2026.11剛剛發布
Tesseract OCR在您需要的語言,我們支援超過125種。