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
Private cancel_time As Integer = 1000
' 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 with specified cancel time
Dim ocrRead As OcrReadTask = ocrTesseract.ReadAsync(ocrInput, cancel_time)
ocrRead.Wait()
Install-Package IronOcr
Timeouts
TimeoutMs provides optional timeout in milliseconds, after which the OCR read operation will be cancelled.
Similar to AbortToken, TimeoutMS also helps with reading large input file in the case that there's a stuck while the program or application is running.
Please note that the feature is not supported in .NET Framework 4.x.x.
Related Docs Links
Ready to get started? Version: 2024.11 just released