×

pdf jspdf

非常好的在网页中显示pdf的方法

admin admin 发表于2015-01-07 08:52:25 浏览913 评论0

抢沙发发表评论

  今天有一需求,要在网页中显示pdf,于是立马开始搜索解决方案,无意中发现一个非常好的解决方法,详见http://blogs.adobe.com/pdfdevjunkie/web_designers_guide。

  其实就光看这个网站也足够了,http://www.pdfobject.com/。

  记录一下主要代码:

  <script type="text/javascript" src="scripts/pdfobject/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>