环境
需要使用到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
演示效果
![这里写图片描述](https://img-blog.csdn.net/20160625094201579)