I think the answer may be yes and no. Here’s some code that can be replaced/inserted into the HTMLview sample project to see the effect:
HTMLview1.innerHTML="<iframe src='year.pdf' width=310 height=260 onload=FrameIsLoaded()></iframe>"
console.log("The iframe is loaded")
$("#HTMLview1 embed").on("load", DocIsLoaded)
console.log("The pdf is loaded")
It’s easy enough to add a listener to the iframe to detect when it has loaded. The console records the moment the iframe has content and the PDF begins to load. For all content types except PDFs, this may be enough.
But the listener I’ve placed on the
embed tag never fires. I’ve read that it’s actually not possible to determine when a PDF has finished loading in an iframe but it seems like it should be.
Of course, the listener has to be created after the element is created otherwise it won’t work, which is why I placed the
embed tag listener where I did. But I must still be doing something wrong.
Anyway, I post this in the hopes that you or someone else may see something there that would lead to a solution.