PDF文件无法打开

发布于 7 年前作者 chaoxiao6903 次浏览最后编辑 7 年前来自 ask

按照官方文档给的wx.openDocument方法 ,文档下载完成后,不调用wx.openDocument方法。

wx.downloadFile({
  url: 'http://example.com/somefile.pdf',
  success: function (res) {    var filePath = res.tempFilePath 
    wx.openDocument({
      filePath: filePath,
      success: function (res) {        console.log('打开文档成功')
      }
    })
  }
})
0 回复
暂无回复