I'm trying to convert blob that I receive it as a buffer to pdf,
exports.findAll = (req, res) => {
leave.findAll({where:{Reponse:null} , attributes:['Document']})
.then(leave => {
console.log(leave[0].Document);
// outPut
// <Buffer 5b 6f 62 6a 65 63 74 20 4f 62 6a 65 63 74 5d>
var buffer = new Buffer.from(leave[0].Document);
console.log(buffer.toString('utf8'));
//[object Object]
});
the leave[0].Document is a blob file from my database