在线pdf、word、excel、ppt在线预览

阿里云浏览文档:https://help.aliyun.com/document_detail/162639.html?spm=a2c4g.11186623.6.567.7ee41fc4uSpkgE

vue浏览插件:https://github.com/cainsyake/vue-doc-preview/blob/master/README-CN.md

预览pdf
1. iframe
:src="url"
ref="ifamePage"
width="100%"
frameborder="no"
border="0"
marginwidth="0"
marginheight="0"
height="100%"

您的浏览器不支持iframe标签


url:'http://cloudt-aliyun-test-vpc-pub.oss-cn-beijing.aliyuncs.com/safe/education_files/GPD20191218.pdf',

总结:
1)pdf展示的很好,
2)word、excel、ppt不支持,直接下载了

方法2

方法3:
object
同上

方法4:https://pdfobject.com/

http://jhyt.oss-cn-shanghai.aliyuncs.com/images/1531367199089_PDFObject.js

ie解决方案:(个人觉得也不好)
https://blog.csdn.net/qq_38975553/article/details/104261830?utm_medium=distribute.pc_relevant_download.none-task-blog-blogcommendfrombaidu-1.nonecase&depth_1-utm_source=distribute.pc_relevant_download.none-task-blog-blogcommendfrombaidu-1.nonecas

以上4种方法的缺点:不支持ie

方法5:(目前看最佳)

https://github.com/mozilla/pdf.js#online-demo

http://blog.lookpeakfans.xyz/2018/07/22/preview-pdf/

二、word、xls、ppt文件在线预览功能