Safari: Printing web pages with big background images

Posted by Pierre Igot in: Macintosh
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 “IP Printing” protocol in Printer Setup Utility and the “Socket/HP JetDirect” option under “Printer Type“.

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 “IP Printing” 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.


4 Responses to “Safari: Printing web pages with big background images”

  1. Olivier says:

    Funny, I noticed this check box (which appears to be off by default) for the first time mere hours before I read this.

  2. ssp says:

    You’re definitely right about the updates. Safari’s lack of support for this was one of my criticisms of Safari 1.0 (http://earthlingsoft.net/ssp/blog/2003/06/safari_1). I didn’t track all changes precisely, but the feature may only have been added in Safari 1.2.

  3. Pierre Igot says:

    The iMac where this happened must have had an older version of Safari, because it definitely did not have this section in the print sheet. (I checked.) But you’re right, it’s there on my machine here, so it must have been added in a more recent version of Safari.

    I’ll update Safari on those machines then.

  4. ssp says:

    The checkbox you’re looking for is in the ‘Safari’ section of the print sheet (where it belongs).

    But you’re right that AppleTalk is still _the_ protocol for printing. It has never failed me. (Printing like it’s 1994 ? the industry should be ashamed that they couldn’t improve in the past decade…)

Leave a Reply

Comments are closed.