API Reference > Accusoft.OCRXpress.Nodejs > Functions Reference > recognize |
Performs character recognition on an image and optionally outputs the results to a file.
Copy Code | |
---|---|
var ocrx = require('ocr'); ocrx.recognize(recognizeParams, function(err, document) { //... }); |
recognizeParams | A set of options that are used to tune the OCR analysis process. |
err | Either undefined or an error describing an error that occurred with the OCR analysis. |
document | A memory structure representing the analyzed document structure of the image. See Document for more information. |
Copy Code | |
---|---|
var ocrx = require('ocr'); var params = { input: 'image.bmp', output: 'output.pdf' }; ocrx.recognize(params, function(err, doc) { if(err) { console.error(err); return; } console.log('OCR of input.bmp -> output.pdf has finished.'); console.log('Recognized text is as follows:); console.log(doc.text); }); |