2

What is the best way to show PDF file in DIV.

I need to show generated PDF into one of the tab of jquery Accordian tab.

Can any one guide what is the best way to move.

dhaval soni
  • 165
  • 1
  • 2
  • 12
  • 1
    You can refer this : http://stackoverflow.com/a/14690795/2555647 . I tested it on Firefox it worked. – Vivek Tankaria Apr 29 '15 at 11:04
  • 1
    Possible duplicate of: http://stackoverflow.com/questions/291813/recommended-way-to-embed-pdf-in-html – zed Apr 29 '15 at 18:48

3 Answers3

12

I used below option to embed:

    <embed src="pdfFiles/interfaces.pdf" width="600" height="500" alt="pdf" pluginspage="http://www.adobe.com/products/acrobat/readstep2.html">
dhaval soni
  • 165
  • 1
  • 2
  • 12
4

Try using this

<div class="PDF">
   <object data="your.pdf" type="application/pdf" width="750" height="600">
       alt : <a href="your.pdf">your.pdf</a>
   </object>
</div>
stanze
  • 2,456
  • 10
  • 13
1

$obj = $('<object>');
$obj.attr("data","http://infolab.stanford.edu/pub/papers/google.pdf");
$obj.attr("type","application/pdf");
$obj.addClass("w100");

$("#pdfdiv_content").append($obj);
#pdfdiv_content{
 width:100%;
 height:250px;
 border:1px solid #0000FF;
 position:relative;
 height:800px;
}
.w100{
 width:100%;
 position:absolute;
 height:100%;
 }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<div id="pdfdiv_content"></div>