Closed Loksly closed 8 years ago
Pushed change and published as 1.0.9. Thanks for the correction!
Extract from a pdf file which contains a scanned image and no searchable text
var inspect = require('eyes').inspector({maxLength:20000});
var pdf_extract = require('pdf-extract');
var absolute_path_to_pdf = '~/Downloads/sample.pdf'
var options = {
type: 'ocr' // perform ocr to get the text within the scanned image
}
var processor = pdf_extract(absolute_path_to_pdf, options, function(err) {
if (err) {
return callback(err);
}
});
processor.on('complete', function(data) {
inspect(data.text_pages, 'extracted text pages');
callback(null, text_pages); //<----- same typo, data.text_pages instead of just text_pages.
});
processor.on('error', function(err) {
inspect(err, 'error while extracting pages');
return callback(err);
});
Thanks again. Have a nice day.
Text extract from searchable pdf
Extract from a pdf file which contains actual searchable text
I guess this little typo doesn't deserve a fork and a pull request. Thank you very much for your software.