def ocrToStream(){
def imageFile = new File("path\\to.PNG")
ITesseract instance = new Tesseract1() // JNA Direct Mapping
instance.setDatapath("<parentPath>") // replace <parentPath> with path to parent directory of tessdata
instance.setLanguage("fra")
try {
def result = instance.doOCR(imageFile)
System.out.println(result)
} catch (TesseractException e) {
System.err.println(e.getMessage())
} catch (IOException e) {
System.err.println(e.getMessage())
}
}