dbashford / textract

node.js module for extracting text from html, pdf, doc, docx, xls, xlsx, csv, pptx, png, jpg, gif, rtf and more!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Incorrect parameters passed to textract.

sunnysharma03 opened this issue · comments

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 ?

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