Hello you wonderful people you.

I am getting most upset with a pathetically unimportant bit of code.

I have an iFrame. This iFrame loads a php script, the php script is not however html, it is a pdf document generated on the fly with FPDF.

I have a second iFrame, this has a spinny gif 'loading' thingy.

both iFrames have the same dimensions, one is set to display: block; whilst the other is set to display: none;

I can make the browser load the pdf document in the iFrame whilst display is none, and the loading screen is hapily spinning around, unfortunately, I have had absolutely no luck in triggering the display to switch to block on the pdf and none on the loading screen once the pd has loaded completely.

document.window.getElementById('myPdfFrame').complete doesnt help me
document.window.getElementById('myPdfFrame').window.status is undefined

the iFrame onload is only triggered the first time the parent page is loaded.

im stuck!

any ideas?
Thanks,
Ben

Member Avatar for LastMitch

I can make the browser load the pdf document in the iFrame whilst display is none, and the loading screen is hapily spinning around, unfortunately, I have had absolutely no luck in triggering the display to switch to block on the pdf and none on the loading screen once the pd has loaded completely.

I'm not why you used:

document.window.getElementById('myPdfFrame')
document.window.getElementById('myPdfFrame')

You just want to load the flippin.pdf?

I think it's myPdfFrame issue it's not reading it correctly.

Then you might include this plugin:

http://mozilla.github.io/pdf.js/

This is the demo:

http://mozilla.github.io/pdf.js/web/viewer.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.