Print html-content in IE 6/7 not working

Page: 1

Author Post
hempelr
Guest
First, thanks for that awesome piece of software - ist the best lightbox I've found on the web till today ;-)

Now, my problem:
on the site http://www.stelisabeth-buerstadt.de its not possible to print the news which appear in a floatbox in the IEs. (look at the link "mehr.." in the upper middle of the site on the right side)
In FF all ok, the Print-Dialog appears and in the background of it the iframe-content will be opened in a new browserwindow - and the printout ist o.k.

But in IEs there is a phenomen, that a window ist lightning on and dissapears right away, nothing more happens.

Anyone any idea what coult I've done wrong?
Thanks for every small Idea, but my customer is a bit angry about that...and I've no idea :(
« Last edit by Unknown on Fri Mar 13, 2009 9:57 pm. »
Administrator
Registered: Aug 2008
Posts: 3382
Nothing you've done wrong. Rather, it's something I've done wrong.

The print function in v3.24 is buggy. I don't know if this will address the issue you are having or not, but if you don't mind editing your floatbox.js file, there is a potential solution. Please see this thread. In particular edit floatbox.js with the patches described in postings #8 and #12 in that thread. (#8 gives you what to change, #12 gives you the best version of what to change it to.)

I know this editing is a bit of a pain, but it's the best I've got for you right now. If doing this code patching does not resolve your problem, let me know and I'll look into further.

Cheers...
hempelr
Guest
Thank you very much - it works...

One thing is a bit confusable, it is a relative long time till the print-dialog appears (ca. 3 - 8s on my 385kbit-dsl-line) - I've testet in a VM on a Linux-Host, but also on a "native" Windows on another Notebook and also on a Desktop-PC
There are somewhere a possibility to shorten this time?
Sorry for the ongoing "crab"...
Administrator
Registered: Aug 2008
Posts: 3382
I don't know what might be causing slowness for you in having the print dialog come up. I can't reproduce that. On every system I test with, the print dialog pops right up in about a second, and that includes the print links from the news items on your site. Perhaps it does have to do with a slower network link at your site, but unfortunately I have no suggestions to help you speed it up.

It would be interesting to hear from other people if they too experience slowness in displaying the print dialog.
hempelr
Guest
ok, I've misinterpretet the thinks that happen, sorry.

Its so that the window, which loads the print-content must have the focus and explizit activated with the mouse, otherwise the print-dialog does not appear.
Now I don'n know, if my cms is the cause or some other circumstances.
I think that ist reproducible on the spcific website under
the url on my first post because some user did report this also.
Thank you for your edurance and please don't loose your temper ;)
Administrator
Registered: Aug 2008
Posts: 3382
Don't worry about me getting grumpy. I'm really glad for the opportunity to find and fix problems with floatbox. Not everything shows up on my testing.

But printing is still a problem. This is a disappointment. It's been a really troublesome feature to stabilize, and it sounds like it's still not there yet.

When I tried to print a news item story on your site from IE7, the new window popped up with the story content ok, but the the code never fired to invoke the print dialog. The new window just sat there being useless.

I've got a second problem. My main machine at home is currently crashed and non-functional thanks to a windows live messenger update gone horribly wrong. That means I'm not currently in a position to replicate your problem on my system and work it out there. So, if you're willing, I'd like to ask you to try yet another code patch to floatbox.js and see if it does a better job of invoking the print dialog from your pages.

If you're game, look right near the bottom of the printContents function. You will see the following code (if your floatbox.js file has already been patched as per the other thread):
	pdoc.open('text/html');
pdoc.write(&#039;<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">&#039; +
&#039;<html><head>&#039; + styles + &#039;<script type="text/javascript">&#039; +
&#039;window.onload = function() { setTimeout(function() { document.body.focus(); print(); close(); }, 200) };&#039; +
&#039;</script></head><body>&#039; + html + &#039;</body></html>&#039;);
pdoc.close();


Replace that entire block with:
	pdoc.open(&#039;text/html&#039;);
pdoc.write(&#039;<!DOCTYPE html><html><head>&#039; + styles + &#039;</head><body>&#039; + html +
&#039;<script type="text/javascript">&#039; +
&#039;setTimeout(function() { document.getElementsByTagName("body")[0].focus(); print(); close(); }, 200);&#039; +
&#039;</script></body></html>&#039;);
pdoc.close();


Sorry about all this damn code patching. Floatbox is suppose to be easier to use than that. But if this works, we both win. And if it doesn't work, I'll have learned something.
hempelr
Guest
Wow - you are a hero! :)
Now it works awesome, the print-problem seems to be solved.
Thank you very much, and thanks for this fast work out of a running solution.

Greetings from the Ore Mountains (also known as Christmas Land) from Germany and best regards

Ruben

Page: 1