中止令牌
该功能允许用户以毫秒为单位暂停当前线程一段时间。
这有助于在程序或应用程序运行时出现卡顿的情况下读取大型输入文件。
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
该功能允许用户以毫秒为单位暂停当前线程一段时间。
这有助于在程序或应用程序运行时出现卡顿的情况下读取大型输入文件。