We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

OCRProcessor.PerformOCR cancel OCR

Thread ID:





149401 Nov 25,2019 08:57 AM UTC Dec 17,2019 12:00 PM UTC WinForms 3
Tags: PDF
Marek Opanas
Asked On November 25, 2019 08:57 AM UTC

How to control OCRProcessor.PerformOCR method timeout or cancel OCR itself whenTesseract engine is used? I can kill the running thread but I find that OCRProcessor.PerformOCRlaunches another process with the extension .tmp which is not killed when I abort C# thread where OCRProcessor running.

Sowmiya Loganathan [Syncfusion]
Replied On November 26, 2019 11:56 AM UTC

Hi Marek, 

Thank you for contacting Syncfusion support.  

We have analyzed your requirement. When tried to kill the running thread of OCR with Tesseract version 3.02, it will not kill the another process of OCRProcessor.PerformOCRlaunches with extension .tmp. However we can achieve your requirement by using Tesseract 3.05 version with enabling of “EnableNativeCall” property in 64-bit binaries (This 64-bit binaries should require when the native call property is enabled). Please find the X64 bit supporting tesseract binaries download link from below, 

While performing OCR with this settings, it will not create the another process as like the above. Please refer the below code snippet for more details, 

//Load a PDF document 
PdfLoadedDocument lDoc = new PdfLoadedDocument("input.pdf"); 
//Set OCR language to process 
processor.Settings.Language = Languages.English; 
//Set tesseract OCR version  
processor.Settings.TesseractVersion = TesseractVersion.Version3_05; 
//Enable native call  
processor.Settings.EnableNativeCall = true; 
//Process OCR by providing the PDF document and Tesseract data 
string str = processor.PerformOCR(lDoc, @"Tessdata/", true); 

Please refer the below UG documentation link for more details, 

Kindly try the above solution in your end and let us knw the result.  

Sowmiya Loganathan 

Marek Opanas
Replied On December 16, 2019 02:18 PM UTC

Thank you. You could improve your library by adding the Cancel() method and the library would take care of canceling OCR. Just suggestion.

Sowmiya Loganathan [Syncfusion]
Replied On December 17, 2019 12:00 PM UTC

Hi Marek, 

Thank you for the suggestion. We will consider this.  

Sowmiya Loganathan 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon