Hi there, I am trying to OCR a multipage TIFF in JAVA. It works fine if i have the input type set to SingleImage, but when I try to set it to TIFF, I get no results. Code below. This is in ColdFusion, but it uses Java. The “createObject(“java”, “com.aspose.ocr.AsposeOCR”)” command is just how I instantiate the Java object. The init() command is calling the constructor. Thanks!
<cfimage source="NICUrep09142022171643001_09142022181951.tiff" name="myImage">
<cfset x = ImageGetBufferedImage(myImage)>
<cfscript>
InputType = createObject("java", "com.aspose.ocr.InputType");
OCRReader = createObject("java", "com.aspose.ocr.AsposeOCR");
myOcrInput = createObject("java", "com.aspose.ocr.OcrInput");
Language = createObject("java", "com.aspose.ocr.Language");
RecognitionResult = createObject("java", "com.aspose.ocr.RecognitionResult");
RecognitionSettings = createObject("java", "com.aspose.ocr.RecognitionSettings");
RecognitionSettings.init();
RecognitionSettings.setLanguage(Language.Eng);
myOcrInput.init(InputType.TIFF);
myOcrInput.add(x,0,2);
Resu = OCRReader.Recognize(myOcrInput);
writeDump(resu);