September 9th, 2004 • 4:40 am
Here’s another, more serious problem that I uncovered this morning on our office’s iMacs. We have a laser printer (HP 2100) which, for a number of reasons, needs to be visible from the outside world with a permanent public IP address. So I’ve set up the iMacs so that they can print to it via TCP/IP, using the “” protocol in Printer Setup Utility and the “ ” option under “ “.
This seems to be working fine from most applications. However, this morning I was called because someone was having trouble printing web pages from within Safari on this particular printer. The symptoms were that the printing process appears to be initiated properly, but then the job stayed stuck in the HP 2100′s printer queue on the iMac for a very long time (up to 15 minutes or even more), during which the printer itself was stuck in the “printing in progress” stage with the green light blinking endlessly and nothing happening. Worse still, this rendered the printer unusable for other users on the network.
This problem didn’t affect all web pages in Safari. I tried several other web pages and they printed fine. But for this particular web page, the problem was 100% reproducible.
Strangely enough, printing the same web page from within Explorer worked just fine.
Then I took a closer look at what the printed web page would look like when printing it from Safari, using the “Preview” button to open a PDF preview of the print job in the Preview application. And that’s when I noticed that, contrary to Explorer, Safari appeared to include the web page’s fairly large background image when printing it. Explorer was just printing the text over a white background. But Safari was attempting to be more faithful to the web page by printing the text over the same background image that was used when displaying the page on the screen.
I remembered experiencing pretty long delays at home with my printer (connected via AppleTalk) when printing web pages with large images from within Safari. So I started suspecting that background image.
I saved a local copy of the web page as an HTML file and edited it using TextEdit. I removed the
background attribute in the
body tag, saved the file, and tried to open that locally saved file with Safari. The background image was gone, of course. I then tried to print that page on the HP. It printed just fine.
The moral here? Safari does two things wrong. First, it tries to include the web page’s background image when printing it, which is really not a very good idea. (It rarely produces readable results, especially on a black and white laser printer.) And then for some reason if the background picture is fairly large — i.e. a GIF file of x hundred pixels by y hundred pixels — even though it’s not actually big in terms of file size, Safari chokes on it for a very long time before it finally prints it. And apparently, using the “” protocol over the Internet makes the problem even worse.
For now, I have had to recommend that people use Explorer rather than Safari for this particular web site. (I can’t see an option to print web pages without their background pictures anywhere in the Safari preferences.) I am not too particularly happy with this solution, of course. In the next few weeks, however, we are going to move the HP printer back behind our firewall and it will be back on the same local network as the iMacs, so I should be able to revert to printing via AppleTalk. Hopefully this will fix the problem and people will be able to print even this type of web page from within Safari.