无法将缓冲区转换为pdf

时间:2020-05-16 02:57:42

标签: node.js express

我正在尝试将作为缓冲区接收的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文件

0 个答案:

没有答案