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

Tesseract engine has not been initialized

Hello,

I want to change an PDF to OCR.

I do it in the following way:

            var appPath = Environment.CurrentDirectory + "\\OCR\\Tesseract binaries\\";

            var dataPath = Environment.CurrentDirectory + "\\OCR\\tessdata\\";

            using (OCRProcessor processor = new OCRProcessor(appPath))

            {
                PdfLoadedDocument loadedDocument = new PdfLoadedDocument(_geladenesDokument);
                processor.Settings.TesseractVersion = TesseractVersion.Version4_0;
                processor.Settings.Language = "deu";
                processor.PerformOCR(loadedDocument, dataPath);      
                 loadedDocument.Save(_geladenesDokument);

                loadedDocument.Close(true);

            }


I ever get the error "Tesseract engine has not been initialized"

I have an OCR folder with the following information, which I got from the downloaded OCR setup from the SyncFusion Donwload site.

Folder OCR/Tesseract binaries:

      leptonica-1.80.0.dll

      libSyncfusionTesseract.dll

Folder Tessdate:

   deu.traineddata

 

I use WPF/ Net 4.8, I compile as x64. (The Tesseract  libraries are also x64).

Do I miss anything ?

Thanks and regards

Uwe





3 Replies 1 reply marked as answer

KS Karmegam Seerangan Syncfusion Team March 22, 2024 06:26 AM UTC

Hi Uwe Porsch,


Thank you for reaching out to Syncfusion support.

 

We have checked the reported issue on our end. The reported issue occurs due to Tesseract binaries are not in the required structure. While performing OCR, the binaries paths are automatically copied and default binaries path references are added in the package itself. We can also set the manual binaries path. However, we have attached the WPF sample for your reference.

 

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/OCR_Processor_WPF-1779497847

You can find the tesseract binaries and tessdata in the folder structure. "bin\Debug\runtimes\TesseractBinaries\4.0\"

Troubleshooting PDF OCR failures | Syncfusion

Kindly try the sample and let us know the result. If you are still facing the issue, we kindly request you to share the modified sample, package name, package version, and environment details (such as OS, bit version, RAM, and culture settings) to replicate the same issue on our end. This will be more helpful for us to analyze and provide you with a prompt solution.


Regards,

Karmegm


Marked as answer

UP Uwe Porsch replied to Karmegam Seerangan March 22, 2024 02:21 PM UTC

Thanks alot, it works now.

Regards

Uwe



KS Karmegam Seerangan Syncfusion Team March 25, 2024 05:03 AM UTC

We are glad to hear that the issue has been resolved. please get back to us if you need any further assistance 


Loader.
Live Chat Icon For mobile
Up arrow icon