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

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

记录一下主要代码:

<script type="text/javascript" src=http://www.dede58.com/"/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=http://www.dede58.com/"~/pdf/CGVET22-08-2011V2P.pdf">Click here to download the PDF</a></div>  

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

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

pdfobject.js下载地址:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/73354b9376aabe574390df76c3e2da88.html