当前位置:网站首页>applet preview pdf
applet preview pdf
2022-07-29 22:15:00 【~Memories】
1.添加jquery.qrcode.min.js和jquery-3.6.0.min.js
2.In the preview to be implementedpdfFeature page introduction==>import Pdfh5 from ‘pdfh5’
效果
页面代码
<!-- 富文本弹出框(阅读协议) Activate warranty -->
<van-dialog
use-slot
:title="dialog.title"
:class="dialog.countdown ? 'zb' : ''"
:show="dialog.show"
:show-cancel-button="dialog.showCancelButton && !formData[dialog.extField.name]"
:confirm-button-text="
dialog.confirmText + (dialog.countdown ? '(' + dialog.countdown + 's)' : '')
"
:cancel-button-text="dialog.cancelText"
@confirm="dialogConfirm"
@cancel="dialogCancel"
>
<view style="height: 50vh; overflow-y: auto; font-size: 15px; padding: 20rpx">
<div id="pdfFileShow" style="width: auto; height: auto"></div>
</view>
</van-dialog>
//实例化pdf- js代码
return {
pdfurl:'',
pdfh5:null,
// 弹窗(Such as reading the agreement)
dialog: {
show: false,
extField: {
// frontEndConfig:{
// confirmText:"同意",
// cancelText:"不同意",
// time:10, //How many seconds to read at least
// must:true, //Is it necessary to agree
// title:"",
// text:"",
// content:""
// }
}
}
}
this.pdfh5 = new Pdfh5($("#pdfFileShow"),{
zoomEnable: true, //是否允许pdf手势缩放
renderType: 'svg', //pdf渲染模式 svg canvas,
data: res.data
})
//监听完成事件
this.pdfh5.on("complete",function(status,msg,time){
console.log("状态:" + status + ",信息:" +
msg + ",耗时:" + time + "毫秒,总页数:" + this.totalNum)
});
//The method is called after the preview agrees
dialogConfirm() {
}
//A pop-up box cancels the operation
dialogCancel() {
if (this.dialog.timer) {
clearInterval(this.dialog.timer);
}
this.dialog.show = false;
}
style样式
.zb /deep/ .van-dialog__footer .van-dialog__button:last-child {
pointer-events: none;
}
边栏推荐
- 网站ping端口的操作方法和命令介绍
- LeetCode--single linked list--146.LRU cache
- 容器网络硬核技术内幕 (25) 知微知彰,知柔知刚 (中)
- How to implement your personal knowledge base?
- The world is on fire, Google servers have crashed
- leetcode122. Best Time to Buy and Sell Stock II
- 给图片左上角加logo标识、左下角加时间和地址、地址到达指定长度换行
- 336. Palindromic Pairs
- SwiftUI 手势大全之可用的手势类型有哪些(教程含源码)
- 干货!联邦学习中的合作均衡
猜你喜欢
随机推荐
OAuth,JWT ,OIDC你们搞得我好乱啊
【593. Valid Square】
网络通信编程基础,BIO,NIO
bright day
5V升压充电8.4V芯片
mdnice-test
数组和List互转
ALBERT:A Lite BERT for Self-supervised Learning of Language Representations
网安学习-内网渗透2
数字孪生万物可视 | 联接现实世界与数字空间
错误解决:Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255]
Panorama Tutorial丨How to shoot sunrise and sunset scenes in VR panoramic shooting?
组合模式(Composite Pattern)
24小时伦敦金走势图分析
qt中qstring合并字符串
Chrome浏览器打印flash log
微信小程序 30 自定义模板和获取用户登录凭证
Dry goods!Cooperative Balance in Federated Learning
PyQt5学习一(环境搭建)
品牌广告投放平台的中台化应用与实践









