此功能允許用戶以指定的毫秒為單位暫停當前線程。
這有助於在程式或應用程式運行中有卡住情況時閱讀大型輸入文件。
使用 IronOCR 探索非同步 OCR 操作。using IronOcr;
using System.Threading;
// Opens a Large PDF which may need to be cancelled early
IronTesseract ocrTesseract = new IronTesseract() { Language = OcrLanguage.English };
using var ocrInput = new OcrInput();
ocrInput.LoadPdf("large-report.pdf");
// Starts a read on the PDF using IronOCR
OcrReadTask ocrRead = ocrTesseract.ReadAsync(ocrInput);
Thread.Sleep(1000); // Time passes...
// Cancellation Example:
ocrRead.Cancel();
ocrRead.Wait();
Imports IronOcr
Imports System.Threading
' Opens a Large PDF which may need to be cancelled early
Dim ocrTesseract As New IronTesseract() With {.Language = OcrLanguage.English}
Using ocrInput = New OcrInput()
ocrInput.LoadPdf("large-report.pdf")
' Starts a read on the PDF using IronOCR
Dim ocrRead As OcrReadTask = ocrTesseract.ReadAsync(ocrInput)
Thread.Sleep(1000) ' Time passes...
' Cancellation Example:
ocrRead.Cancel()
ocrRead.Wait()
End UsingImports IronOcr
Imports System.Threading
' Opens a Large PDF which may need to be cancelled early
Dim ocrTesseract As New IronTesseract() With {.Language = OcrLanguage.English}
Using ocrInput = New OcrInput()
ocrInput.LoadPdf("large-report.pdf")
' Starts a read on the PDF using IronOCR
Dim ocrRead As OcrReadTask = ocrTesseract.ReadAsync(ocrInput)
Thread.Sleep(1000) ' Time passes...
' Cancellation Example:
ocrRead.Cancel()
ocrRead.Wait()
End Using此功能允許用戶以指定的毫秒為單位暫停當前線程。
這有助於在程式或應用程式運行中有卡住情況時閱讀大型輸入文件。
使用 IronOCR 探索非同步 OCR 操作。NuGet 下載次數 6,394,824|版本:2026.11剛剛發布
Tesseract OCR在您需要的語言,我們支援超過125種。