中止令牌
此功能允許使用者將當前執行緒暫停指定的毫秒時間。
這有助於在程序或應用程式運行時卡住的情況下讀取大型輸入文件。
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 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 Dim ocrRead As OcrReadTask = ocrTesseract.ReadAsync(ocrInput) Thread.Sleep(1000) ' Time passes... ' Cancellation Example: ocrRead.Cancel() ocrRead.Wait()
Install-Package IronOcr
此功能允許使用者將當前執行緒暫停指定的毫秒時間。
這有助於在程序或應用程式運行時卡住的情況下讀取大型輸入文件。