//预览pdf 创建临时文件直接打开
var ba64=retb.obj;
var fs = wx.getFileSystemManager();
fs.writeFile({
filePath: wx.env.USER_DATA_PATH + "/" + 'PDF.pdf',
data: wx.base64ToArrayBuffer(ba64.replace(/[\r\n]/g, "")),
success: res => {
wx.openDocument({
filePath: wx.env.USER_DATA_PATH + "/" + 'PDF.pdf',
success: function (res) {
console.log('打开PDF成功');
},
fail(err) {
console.log(err)
}
})
}
})