We are using the HOCR Callback method to OCR images and add the resulted text into the PDF.
This however results in a stacktrace:
Exception in thread “main” class com.aspose.pdf.internal.ms.System.lh: Invalid index: index should be in the range [1…n] where n equals to the operators count.
com.aspose.pdf.OperatorCollection.lI(Unknown Source)
com.aspose.pdf.OperatorCollection.get_Item(Unknown Source)
com.aspose.pdf.internal.l8f.l0v.lI(Unknown Source)
com.aspose.pdf.ADocument.convert(Unknown Source)
com.aspose.pdf.Document.convert(Unknown Source)
com.rabobank.testpdf.CheckForLibor.checkForLibor(CheckForLibor.java:56)
com.rabobank.testpdf.CheckForLibor.main(CheckForLibor.java:30)
at com.aspose.pdf.OperatorCollection.lI(Unknown Source)
at com.aspose.pdf.OperatorCollection.get_Item(Unknown Source)
at com.aspose.pdf.internal.l8f.l0v.lI(Unknown Source)
at com.aspose.pdf.ADocument.convert(Unknown Source)
at com.aspose.pdf.Document.convert(Unknown Source)
at com.rabobank.testpdf.CheckForLibor.checkForLibor(CheckForLibor.java:56)
at com.rabobank.testpdf.CheckForLibor.main(CheckForLibor.java:30)
THe HOCR String that returns from the OCR callback is: (created by Tesseract OCR module)
\W/z WY HERBERT yyw FREEHILLS IWS
Any ideas why this is happening?