We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Sample code fails

We are trying to execute sample code provided to OCR PDF and Tiff with Aspose.Ocr.Java 22.6 version. We are getting following errors:

OCRRecognizePdf.java

Exception in thread “main” java.lang.NoClassDefFoundError: ai/onnxruntime/OrtEnvironment
at com.aspose.ocr.e0cd0c6d14.f(Unknown Source)
at com.aspose.ocr.e0cd0c7d77.ac8a(Unknown Source)
at com.aspose.ocr.e0cd0c7d77.f(Unknown Source)
at com.aspose.ocr.AsposeOCR.RecognizePage(Unknown Source)
at com.aspose.ocr.pdf.AsposeOCRPdf.RecognizePdf(Unknown Source)
at OCRRecognizePdf.main(OCRRecognizePdf.java:24)
Caused by: java.lang.ClassNotFoundException: ai.onnxruntime.OrtEnvironment
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)

OCRRecognizeTiff.java

Exception in thread “main” com.aspose.ocr.tiff.e0cd0c6d55: Sample bit-width of 1 is not supported
at com.aspose.ocr.tiff.e0cd0c6d18.e0cd0c1d77(Unknown Source)
at com.aspose.ocr.tiff.e0cd0c6d18.f(Unknown Source)
at com.aspose.ocr.tiff.e0cd0c6d18.f(Unknown Source)
at com.aspose.ocr.tiff.e0cd0c6d18.f(Unknown Source)
at com.aspose.ocr.tiff.e0cd0c6d18.f(Unknown Source)
at com.aspose.ocr.tiff.e0cd0c6d18.e0cd0c6d66(Unknown Source)
at com.aspose.ocr.tiff.TiffReader.read(Unknown Source)
at com.aspose.ocr.AsposeOCR.RecognizeTiff(Unknown Source)
at OCRRecognizeTiff.main(OCRRecognizeTiff.java:29)

6 posts were merged into an existing topic: OCR of TIFF image to Searchable PDF