I tried using both your provided test image (…\Aspose\Aspose.OCR for .NET\Examples\ProgrammersGuide\WorkingWithOCRFeatures\GettingNotification\Data\Sampleocr.bmp) and some of my own in two different example projects. All instances throw the same exception on OcrEngine.Process()
Aspose.OCR.OcrException was unhandled
Message=Stream with resource file is empty or damaged. Please initialize resource file manualy.
Source=Aspose.OCR
StackTrace:
at Aspose.OCR.OcrEngine.Process()
at ApplyingCorrectionFiltersExample.Program.Main() in C:\Program Files (x86)\Aspose\Aspose.OCR for .NET\Examples\ProgrammersGuide\WorkingWithOCRFeatures\AdvancedConfigurations\ApplyingCorrectionFilters\CSharp\Program.cs:line 48
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
I see that \WorkingWithOCR\PerformOCROnImage\Data\Resource.zip is needed.
After setting
ocrEngine.Resource = new FileStream(@“…..........\WorkingWithOCR\PerformOCROnImage\Data\Resource.zip”, FileMode.Open);
I am able to complete ocrEngine.Process()
I do not find anything regarding the dependency on “resource.zip” in your documentation. Could you please provide a more complete explanation of what this is and how it is to be deployed?
First of all, please accept our apologies for the inconvenience caused to you.
We are currently investigating the said problem to isolate the problem cause. In the meanwhile, we would suggest you to check the Programmer’s Guide for complete source code snippets of the functionality offered by the Aspose.OCR for .NET API.
Please note, the previous releases (prior to v2.2.0) of Aspose.OCR for .NET required a resource archive to perform the OCR operation for English language. Since the release of Aspose.OCR for .NET 2.2.0, the said resources were embedded in the Aspose.OCR for .NET assembly therefore it is not required to set the resource archive in your source code any more. However, the exception message shown in your original post suggests that the Aspose.Examples Dashboard has fetched the previous version of Aspose.OCR for .NET due to which you are required to manually set the resource archive.
We will keep you posted with updates in this regard. In the meanwhile, if you have any concerns or questions, please feel free to contact us back.
This is to inform you that we are able to replicate the said problems with Aspose.Examples Dashboard for Aspose.OCR examples. We are moving forward to fix these issues, and as soon as the fix is available, we will notify you here.
In the meanwhile, you can easily create your own examples by referring to the Programmer’s Guide provided in our previous response. In case you face any difficulty, please feel free to contact us back.