Join us for an engaging webinar, as we unravel the potential of AI for revolutionizing document management.
Watch Now
Enable your employees to remain productive throughout the document management process.
Read More
Learn how SmartZone uses a regular expression engine integrated into the recognition engine to achieve the best possible accuracy on data that can be defined by a regular expression.
Docubee is an intelligent contract automation platform built to help your team success
In ImageGear, why am I running into AccessViolationExceptions when I run my application in parallel?
This issue can sometimes occur if ImGearPDF is being initialized earlier in the application. In order to use ImGearPDF in a multi-threaded program, it needs to be initialized on a per-thread basis. For example, if you have something like this:
ImGearPDF
ImGearPDF.Initialize(); Parallel.For(...) { // OCR code } ImGearPDF.Terminate();
Change it to this:
Parallel.For(...) { ImGearPDF.Initialize(); // OCR code ImGearPDF.Terminate(); }
The same logic applies to other ImageGear classes, such as ImGearPage instances or the ImGearRecognition class – you should create one instance of each class per thread, rather than creating a single instance and accessing it across threads. In the case of the ImGearRecognition class, you’ll have to use the createUnique parameter to make that possible e.g.:
ImGearPage
ImGearRecognition
createUnique
ImGearRecognition recEngine = ImGearRecognition(true);
instead of
ImGearRecognition recEngine = ImGearRecognition();