Free Support Forum -

Bug in nuget-OCR-Version 19.8.0 and 19.8.1

I just upgraded my Aspose.OCR-nuget-package from version 17.11.0 to 19.8.1, which broke the following code at “ocrEngine.Process()”:

    Aspose.Pdf.License licPDF = new Aspose.Pdf.License();
    Aspose.Pdf.Document pdfDoc = null;
    Aspose.OCR.License licOCR = new Aspose.OCR.License();
    Aspose.OCR.OcrEngine ocrEngine = new Aspose.OCR.OcrEngine();
    using (var ms = new MemoryStream(File.ReadAllBytes(Path.Combine("pathToDocument", "Beispiel3.pdf"))))
        pdfDoc = new Aspose.Pdf.Document(ms);
        if (pdfDoc != null)
            var sb = new StringBuilder();
            foreach (var page in pdfDoc.Pages)
                using (var imageStream = new MemoryStream())
                    var jpegDevice = new Aspose.Pdf.Devices.JpegDevice(new Aspose.Pdf.Devices.Resolution(300), 100);
                    jpegDevice.Process(page, imageStream);
                    imageStream.Position = 0;
                    ocrEngine.Image = Aspose.OCR.ImageStream.FromStream(imageStream, ImageStreamFormat.Jpg);
                    if (ocrEngine.Process())

The error states:

Aspose.OCR.OcrException : Error occurred during recognition.
  ----> System.IO.FileNotFoundException : The file "pathToMyProject\UnitTest\bin\Debug\data" does not exist.


at Aspose.OCR.OcrEngine. ()
at Aspose.OCR.OcrEngine.Process()
at MyNamespace.UnitTest.AsposeTest_OCR_PDF_to_TXT.Test_AsposeOCR_PDFToText() in pathToMyProject\UnitTest\AsposeTest_OCR_PDF_to_TXT.cs: line 74.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.GetAttributes(String path)
at   .(String , String )
at   .(IEnumerable`1 )
at   ..ctor(IEnumerable`1 )
at   ..ctor()
at   ..ctor()
at   ..ctor(   , Boolean )
at   .(   , Boolean )
at Aspose.OCR.OcrEngine.()

Testing the nuget-version 19.8.0 replicates the same error.

Please find the pdf-file attached:
Beispiel3.pdf (70.6 KB)

Best regards.


We have tested the scenario in our environment and were able to replicate the issue. We have logged it as OCR-797 in our issue tracking system for further investigation. We will look into details of the issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.

experiencing the same issue… Can this be expedited please?

Also in current build 19.9.0


We have recorded your concerns along with the logged issue and will definitely keep you posted on the status of its resolution. Please spare us a little time.

We are sorry for the inconvenience.

Is there any workaround for this? Any code sample on how to use a Build 19.9 Aspose.OCR successfully?

While M.Heinz is trying to OCR a PDF, I am trying to OCR image files such as JPG and PNG files. But it does the exact same thing as what M.Heinz is reporting; it’s coming up with the exact same error. Like M.Heinz my code works fine with Build 17.11, but I cannot find a way to make build 19.9 work at all. I note that it has already taken 2 months since M.Heinz reported this, and I would be very unpleasantly surprised if you had left a completely non-functional product in public release for that long. So I am assuming that this was released on the basis of it working in some scenarios, and it would be helpful if you could find some way of making the current software work… and share it with us poor unfortunates :smile:


Please accept our humble apologies for the inconvenience which has been faced. Please note that the issue is already being investigated and we are trying our best to resolve it as soon as possible. Further releases of the API have also been pending because of this scenario as this is taking time to get resolved.

We will definitely consider your concerns and will surely let you know as soon as we have some definite updates regarding resolution of the ticket or any available workaround. We greatly appreciate your patience and comprehension in this matter. Please spare us little time.

We are sorry for the inconvenience.

Iirc I also tried to OCR an image file, as this is an other application in our software - having the same issues. But having an identical error message and stack trace, I did assume the underlying issue to be the same and therefore didn’t think of reporting this issue as well.

1 Like


We are in process to resolve this issue and hopefully we will be updating you soon about it fix. We really apologize for the inconvenience which has been faced.

1 Like

Any updates on that topic?


Would you kindly try using Aspose.OCR for .NET 19.9.1. It is necessary that you try to build your application in x64 mode instead of AnyCPU. Currently we do not support AnyCPU or x86 architectures because we use specific CPU instruction sets that are not available in x86 mode. In case you still face any issue, please feel free to let us know.

First of all, I’m very disappointed about not beeing kept in the loop about the patch 19.9.1, which apparently dropped about 2 months ago and you just proposed as a possible solution to the issue - when you said, you’d be updating me about a fix.

Secondly, my application relies on beeing build in AnyCPU-mode; therefore x64 is not an option for my productive environment.

Regardless of any of the above: Using Aspose.OCR nuget-version 19.9.1 and building specifically in x64 does not resolve the issue, mentioned in the first post of this topic. None of the behavior did change in any way.

Kind regards.


Please accept our humble apology for this. Please note that the proposed solution was just a workaround and was provided with the fix to another issue reported in a different thread. Whereas, the original issue linked with this forum thread is still unresolved and as we shared earlier, we will surely inform you as soon as it is resolved.

We have noted your concerns and feedback and will surely keep them in view during issue analysis and its resolution. We highly appreciate your patience and comprehension in this matter. Please spare us some time.

We are sorry for the inconvenience.