Printing crashes Internet Explorer 7

Every web developer knows that Internet Explorer does not comply with published web standards. IE7 is much better than IE6, but we still spend many hours restructuring code and/or writing specific stylesheets so that our web pages display acceptably on Microsoft’s browsers. I recently became aware of another problem with Internet Explorer; attempting to print some web pages can cause Internet Explorer to crash. If certain plug-ins, like Google toolbar are installed, “crashing” may be replaced by erratic behavior like redirection to the browser’s home page.

I learned about the crashing problem when one of my clients reported that trying to print a page on their staging site caused the browser’s home page to load; in this case Google. I ran the HTML and CSS validators on W3C with no errors or warnings, but the client was still redirected when they tried to print, and IE7 crashed on my test box when I tried to print. So basically correct, valid, accessible HTML/CSS caused a fatal error in Internet Explorer. The Google toolbar was catching and redirecting the error on my client’s computer which disguised it and made it more difficult to track down.

After much searching, I found a knowledge base article on Adobe’s site which describes this occuring with IE6. The browser “renders the page correctly but crashes when parsing code for the printer”. I believe IE7 suffers from a similar problem, although IE7 may crash on different pages than IE6. Adobe’s fix, adding media=”screen” to the css link tags, allowed the page to print from IE7 without crashing, but, as expected, all page formatting is lost.

Example of stylesheet link:

    <link rel="stylesheet" href="example.css" type="text/css"media="screen">

 
That is ok, even preferable, for most users. Even better would be a specific stylesheet to print a simplified version of the page with extraneous data such as background images stripped out. In fact, I have some clients who would purposely break printing of their site just to save trees, but this particular client wanted their web pages to print as closely as possible to the way they are displayed in the browser. My solution was to provide dynamic PDF generation for printing. I’ll write more details about that in another post.

2 thoughts on “Printing crashes Internet Explorer 7”

  1. Thanks for this article. I had the same problem. After tweaking the style #container > div { } to #container div { } resolved the issue.

Leave a Reply