浅谈pdfobject.js实现网页PDF文件浏览

来源:互联网 发布:网络言论自由 高中作文 编辑:程序博客网 时间:2024/06/09 19:10

环境

需要使用到pdfobject.js或者压缩后的pdfobject.min.js。

示例源码

<!DOCTYPE html><html><head>    <title>网页嵌入pdf浏览器</title>    <script type="text/javascript" src="./js/pdfobject.min.js"></script>    <style type="text/css">        .pdfobject-container { height: 600px;}        .pdfobject { border: 1px solid #666; }    </style></head><body><div id="example1"></div><script type="text/javascript">    PDFObject.embed("./pdf/Python程序设计基础.pdf", "#example1");</script></body></html>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

演示效果

这里写图片描述

原创粉丝点击