小程序预览PDF文件
https://blog.csdn.net/qq_33744228/article/details/80240910(链接)
wx.downloadFile({
url: 'https://*****.***.work/videos/test2.pdf',
success: function (res) {
console.log(res)
var Path = res.tempFilePath //返回的文件临时地址,用于后面打开本地预览所用
wx.openDocument({
filePath: Path,
success: function (res) {
console.log('打开文档成功')
}
})
},
fail:function (res){
console.log(res)
}
})