织梦园模板网提供云优cms模板,pbootcms模板,Wordpress主题模板等各类企业新闻资讯网站模板下载服务。织梦园网站模板交流群
用户名:
密码:
注册
注册后享受折扣价

织梦cms网页中直接显示pdf文档方法

织梦园模板 / 2019-04-17 / 收藏

织梦网页中直接显示pdf文档方法

记录一下主要代码:

<script type="text/javascript" src="/js/pdfobject.js"></script>

<script type="text/javascript">

window.onload = function (){

    var success = new PDFObject({ url: "pdf/CGVET22-08-2011V2P.pdf" ,pdfOpenParams: { scrollbars: '0', toolbar: '0', statusbar: '0'}}).embed("pdf1");

};

</script>

<div id="pdf1" style="width:700px; height:600px;">It appears you don't have Adobe Reader or PDF support in this web browser. <a href="~/pdf/CGVET22-08-2011V2P.pdf">Click here to download the PDF</a></div>

PDFObject.js,是一个 JavaScript 库用来在HTML中动态嵌入 PDF 文档。

只需要引用pdfobject.js,不需要额外的库

pdfobject.js下载地址:

pdfobject.js

相关织梦教程

收缩