using IronOcr;
using System.Threading;
// Opens a Large PDF which may need to be cancelled early
IronTesseract ocrTesseract = new IronTesseract() { Language = OcrLanguage.English };
var ocrInput = new OcrInput("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("large-report.pdf")
' Starts a read on the PDF using IronOCR
Private ocrRead As OcrReadTask = ocrTesseract.ReadAsync(ocrInput)
Thread.Sleep(1000) ' Time passes...
' Cancellation Example:
ocrRead.Cancel()
ocrRead.Wait()