1

I am embedding a pdf document on a HTML5 page using a code similar with:

<div style="background: transparent url(loading.gif) no-repeat">
    <object height="1250px" width="100%" type="application/pdf" data="aaa.pdf">
       <param value="aaa.pdf" name="src"/>
       <param value="transparent" name="wmode"/>
    </object>
</div>

(answer for this question)

At some moment in time I would want to reload the embeded pdf file without reloading the entire page. How can this be made?

Community
  • 1
  • 1
axl g
  • 612
  • 2
  • 9
  • 20

2 Answers2

3

You could use javascript to rewrite the innerHTML of the containing div. So give it an id and then when you decide to reload reassign the contents of this div:

$('#pdf').html('<object height="1250px" ......</object>');
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
2

Put it inside an iframe which you then simply reload. Should be the simplest solution and it will work.

Or try this which might also work

<object id="pdfDoc" ...>
    ...
</object>

$("#pdfDoc").replaceWith($("#pdfDoc"));
Charlie Rudenstål
  • 4,318
  • 1
  • 14
  • 15