diff --git a/lib/tesseract.js b/lib/tesseract.js index db9729a..9520f20 100644 --- a/lib/tesseract.js +++ b/lib/tesseract.js @@ -23,7 +23,8 @@ var Tesseract = { 'l': 'eng', 'psm': 3, 'config': null, - 'binary': 'tesseract' + 'binary': 'tesseract', + 'format': null }, /** @@ -69,6 +70,11 @@ var Tesseract = { command.push(options.config); } + var validFormats = ['hocr', 'tsv']; + if (options.format !== null && validFormats.indexOf(options.format.toLowerCase()) > -1) { + command.push(options.format.toLowerCase()); + } + command = command.join(' '); var opts = options.env || {};