Forum Moderators: open

Message Too Old, No Replies

Printing web pages

         

Road King 48

1:55 am on Apr 25, 2007 (gmt 0)

10+ Year Member



My client wants his pages to print exactly as they display in a browser. My problem is that their design necessitates using background images in tables and the background images don't print out. Is there any way I can get the background images behind the html text to print out?

Ex.
<td background="/images/bg.gif">HTML Text</a?
Only the HTML Text prints out, not bg.gif

Thanks!

Robin_reala

12:25 pm on Apr 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In IE this is under Tools / Options / Advanced / Printing / Print background colors and images. I don't believe you can toggle this directly from your site though. Is this just for your clients purposes so that he can review the pages? If so then I'd suggest to him that he screenshots the pages then prints those.

Really, HTML isn't designed to do what he wants. If he wants to design for print then he might be better going down the PDF route.

thecoalman

7:11 pm on Apr 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If they aren't repeated images and don't require the background color you can position the text over the the image.

<html>
<head>
<style type="text/css">
.overlay
{
position:relative;
left:0px;
top:-300px;
z-index:100
}
</style>
</head>
<body>
<table>
<tr>
<td>
<img src="yourimage.gif" width="300" height="300">
<p class="overlay">Overlayed Text.</p>
</td>
</tr>
</table>
</body>
</html>

Fotiman

9:02 pm on Apr 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I second what Robin_reala said. The web is not print. There's no reason to expect them to be identical. That's why some sites offer "Printer friendly" pages, because you CAN'T force the user's browser to print background images. Plus, differences in print drivers may cause different printed versions as well.

Your best bet would be to tell the client that this just isn't possible with HTML.

Also, trying to position text over absolutely positioned images is a bad idea. Different text sizes may cause your text to not line up correctly.