4

I am trying to load a PDF within an iframe and have to execute few events only when PDF has been loaded. (Note: By PDF getting loaded, I mean PDF contents are visible on screen not the initializing/loading progress bar of Adobe reader). I am using the following code for now:

<iframe id="iframe" src="http://somedomain.com/somfilePatf/someFile.pdf">  

I have tried onload event for iframe but it triggers as soon as page renders the iframe (not when iframe content is completely loaded). Please help me on the same.

Abhishek
  • 539
  • 5
  • 25

2 Answers2

0

Use the below code/function to achieve the required options

<iframe id="iframe" src="http://somedomain.com/somfilePatf/someFile.pdf">  

<script type="text/javascript">
    document.getElementById('iframe').onload = function() {
        functionAfterPDFLoad();
    }
</script>
0

Check this answer: How to open a PDF file in an ?

Deepak Gautam
  • 1,309
  • 12
  • 14