word+excle+pdf表格在線瀏覽
通過(guò)iframe直接引用微軟提供的方法
<iframe src='https://view.officeapps.live.com/op/view.aspx?src=http://storage.xuetangx.com/public_assets/xuetangx/PDF/1.xls' width='100%' height='100%' frameborder='1'></iframe>
在?https://view.officeapps.live.com/op/view.aspx?src= 后邊添加需要預(yù)覽的內(nèi)容
注意:鏈接包含中文需要進(jìn)行URL編碼峻堰,并且文檔必須可在Internet上公開(kāi)訪問(wèn)
官方使用文檔
pdf在線瀏覽
PDF.js下載地址
http://jhyt.oss-cn-shanghai.aliyuncs.com/images/1531367199089_PDFObject.js
使用方法
引入pdf.js文件
<script src="./js/PDF/PDFObject.js" type="text/javascript"></script>c
創(chuàng)建有個(gè)div用于展示
<div id="example1"></div>
通過(guò)js動(dòng)態(tài)添加需要瀏覽的pdf地址
var options = {
? ? ? ? ? ? height: "550px",
? ? ? ? ? ? pdfOpenParams: {view: 'FitV', page: '0' },
? ? ? ? ? ? name:"mans",
? ? ? ? ? ? fallbackLink: "<p>您的瀏覽器暫不支持此pdf,請(qǐng)下載最新的瀏覽器</p>"
? ? ? ? };
PDFObject.embed(url, "#example1",options);
預(yù)覽效果
————————————————
版權(quán)聲明:本文為CSDN博主「superKM」的原創(chuàng)文章盅视,遵循 CC 4.0 BY-SA 版權(quán)協(xié)議捐名,轉(zhuǎn)載請(qǐng)附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/superKM/article/details/81013304