* @param metadata Properties object with (and for) metadata of the document.
* @return OCR result as single string.
* @throws Exception
*/
public static String getOcrTextAndStoreBarcodes(File file, Properties metadata) throws Exception {
OcrViaTesseractUtils ocr = new OcrViaTesseractUtils();
String ext = FileUtils.getFileExtension(file).toLowerCase();
String imageName = file.getCanonicalPath();
File tmpDirectory = new File("tmp");
tmpDirectory.mkdirs();
String ocrName = new File(tmpDirectory, "" + IdUtils.getUniqueID()).getCanonicalPath();