当前位置:网站首页>微信小程序----微信小程序浏览pdf文件
微信小程序----微信小程序浏览pdf文件
2022-07-28 06:45:00 【In Heaven】
微信小程序----微信小程序浏览pdf文件
说明:通过wx.downloadFile,wx.openDocumen来实现打开pdf文件。只需在js操作即可。
HTTP.Config.Request('source/reportinfo', 'POST', {
reportId: id })
.then(function (i) {
let datas = i.data;
/************************/
wx.downloadFile({
url: datas, //要预览的PDF的地址
success: function (res) {
if (res.statusCode === 200) {
//成功
var Path = res.tempFilePath //返回的文件临时地址,用于后面打开本地预览所用
wx.openDocument({
filePath: Path, //要打开的文件路径
success: function (res) {
console.log('打开PDF成功');
}
})
}
},
fail: function (res) {
console.log(res);
}
})
边栏推荐
- Get the clicked line number in qtablewidget
- Tell you step by step what you need to do to apply for PMP? What should I do?
- 豪华版h5俄罗斯方块小游戏源码
- 二维数组及操作
- 2022牛客多校第二场解题报告
- jquey的基础语法
- 本人男,27岁技术经理,收入太高,心头慌得一比
- 聊一聊数据库的行存与列存
- Is the salary of test / development programmers unbalanced? Busy life, all kinds of job hopping
- 【17】 Establish data path (upper): instruction + operation =cpu
猜你喜欢

Is the salary of test / development programmers unbalanced? Busy life, all kinds of job hopping

网口网络水晶头RJ45、POE接口定义线序

Huawei Senior Engineer -- BGP routing filtering and community attributes

uniapp的swiper动态设置current值不生效解决办法

Understand the propagation process of EMI electromagnetic interference through five diagrams - the influence of square wave steepness on high-frequency components, the spectrum graph from time sequenc

Can‘t connect to server on ‘IP‘ (60)

Kubernetes技术与架构(七)

Change the dataDir path after mysql8.0.16 installation

Allure use

Matlab file path
随机推荐
CarSim simulation quick start (XII) - Driver Model (2)
jquey的基础语法
[book club issue 13] Chapter 2 notes on the packaging format and coding format of video files
leetcode/数组中和为0的三个不同数
Mysql, how many columns can be used to create an index?
SQL function
JS card cascading style image switching JS special effect
Usage of qgroupbox
Basic dictionary of deep learning --- activation function, batch size, normalization
Creation of status bar (29)
Characteristics of EMC EMI beads
ASP. Net core foundation VIII
Swm32 series tutorial 5-adc application
feign 调用
Redis of non relational database [jedis client +jedis connection cluster]
MySQL: what is the difference between like and regexp operations?
Mysql-怎么添加用户和设置权限?
c语言中函数的介绍(血书20000字!!!!)
UE4 engine customizes screenpass and MRT output
Talk about row storage and column storage of database