我正在尝试将作为缓冲区接收的blob转换为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]
});
请假[0]。文档是我数据库中的Blob文件