Hbuilderx+vue2+微信小程序 预览pdf

javascript 复制代码
gotoPDF(pdfName) {
	uni.showLoading({
		title: 'loading'
			});
			wx.downloadFile({
				url: `http://211.153.55.36:4426/${pdfName}.pdf`,   // 服务器上的pdf文件地址
				success: function(res) {
					const filePath = res.tempFilePath
					wx.openDocument({
						filePath: filePath,
						fileType: 'pdf',
						showMenu: true,
						success: function(res) {
							uni.hideLoading()
							console.log('打开文档成功')
						},
						fail: function(err) {
							uni.hideLoading()
							console.log('fail:' + JSON.stringify(err));
						},
					})
				}
			})				
}
相关推荐
ilvcn34 分钟前
在线 PDF 翻译工具实测:整份翻译保留表格版式,长文档处理方案
pdf
accept 99%5 小时前
python版提取 PDF 的常用第三方库与工具
开发语言·python·pdf
show4335 小时前
多格式导出怎么做?2026免费小程序TXT/SRT实践
开发语言·小程序·c#
AI砖家6 小时前
AI编程—微信小程序开发规范
微信小程序·小程序·notepad++·ai编程
show43318 小时前
2026小程序端视频转文字技术对比:识别引擎精度实测
小程序·音视频
zyplayer-doc20 小时前
zyplayer-doc企业知识库能做什么:从文档创建、权限管理到AI问答的完整能力
大数据·javascript·数据库·人工智能·pdf·word
sam-zy1 天前
微信小程序+ESP8266+Arduino 开发智能插座,有本地OTA功能
微信小程序·小程序
小短腿乄1 天前
java实现pdf加水印+签名
java·开发语言·pdf
gb42152871 天前
python中unstructured库和langchain-unstructured库在解析pdf文件的时候的区别?
python·langchain·pdf
吹个口哨写代码1 天前
markdown转word、pdf
pdf