Error: Incorrect parameters passed to textract.
sunnysharma03 opened this issue · comments
Sachin Sharma commented
Hi I am trying to read a base64 docx file string by using
var type = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
var config = { preserveLineBreaks: true }
var buffer = base64Docx.txt
textract.fromBufferWithMime(type, [buffer](https://github.com/dbashford/textract/files/3968769/base64Docx.txt), config, function( error, text ) {
console.log(error,text)
});
filebase64: base64Docx.txt
I tried to convert it to buffer too still no luck..
Please let me know what I am doing wrong ?
Sachin Sharma commented
it is solved, i need to convert the base64 string to buffer
let buff = (new Buffer.from(buffer, 'base64'))
and passed it to the textract.fromBufferWithMime
thanks