Forum Moderators: open

Message Too Old, No Replies

IE6 Feature or Bug?

A few questions about printing web pages

         

DaveAtIFG

12:58 am on Sep 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A client asked me to fix her web site last week saying when she prints any of her pages, the right edge is "cut off." She added, "I often hear this complaint from visitors too so it must be something wrong with our site. Pages do print OK in landscape mode." After doing some checking, I told the client, "They print just fine for me. Tell me more about the problem." It seems IE 6 is to blame.

I rarely use IE unless forced to and viewing and printing web pages using Opera 6 or 7, IE 5 or NS4 is pretty much a WYSIWYG affair, they print flawlessly in portrait mode as expected. Looking at "Print Preview" shows IE 6 cutting off the right side of the page just as it does when it prints pages in portrait mode.

This problem was probably discussed to death when IE 6 was released but it's news to me so please be patient with me. :) I'm working with this client on a new design and she wants to "fix" this problem in the new design too.

Since every other browser including earlier versions of IE print WYSIWYG, I suspect this is an IE 6 bug, but it's been out there a year or more and there have been numerous patches and updates released... I'm confused.

After an hour and a half of fruitless searching, I'm left with several questions:
1. Feature or bug? Will IE next operate like this?
2. Can anyone point me to any discussion about this?
3. Is there a simple work around so IE 6 appears to behave like every other browser in the world?

Help! :)

Ryan8720

1:43 am on Sep 1, 2003 (gmt 0)

10+ Year Member



Not enough info. Is it a CSS or table design? Are there floated objects. Are there div elements using the overflow?

DaveAtIFG

2:16 am on Sep 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's a 750 pixel wide table design with a few inline style tags for text formatting, validates as HTML 4.01 Transitional.

txbakers

11:09 am on Sep 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IE 6 default margins are .75 in all directions, plus headers and footers.

have her remove headers and footers and set margins to 0 and she should be able to print.

DaveAtIFG

8:14 am on Sep 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Although I appreciate the responses, none of them really told me what I wanted to know. I was hoping for a server side fix. They did trigger some new ideas however and here's what I've learned. (I thought I'd put it all in one place for the next poor fool who encounters this problem! :) )

In IE6 the default left/right print margins (.75 inches) tolerate a table or image up to 673 pixels wide before cropping the right side when printing in portrait mode.

If print margins are manually set to zero, IE6 forces them to .25 inches and then tolerates a table or image up to 769 pixels before cropping.

There are CSS2 controls in the W3C spec that should permit overriding this width limit but IE6 doesn't support them.

I don't speak JavaScript but experts are consistent in saying that printer margins cannot be set via JavaScript.

If you MUST have a server side fix, there is a commercial product available that claims to offer complete control over printed content called ScriptX using ASP scripting. It seems to be the only way to make pages that are too wide print WYSIWYG in IE6. I didn't explore it, I've had enough! ;)

FWIW

txbakers

3:04 pm on Sep 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I looked at ScriptX and it didn't work.

The problem is not in the browser or the serverside code, the problem is that every printer driver sets their own minimum margins. You found that .25 was the minimum on your printer, (mine too) but in working with clients I found that there were so many minimums it was crazy.

I was trying to print mailing labels on to label stock from the browser. It worked perfectly on my printer, but my customers were having difficulty. I looked for all kinds of solutions, including the ScriptX above, and nothing worked. I was getting ready to pay for an ActiveX to be written when I isolated the main problem and fixed it with some nifty javascript.

The problem for me was the bottom margin changing on every printer. So I figured out a way to let the user set their own bottom margin using a slider. Then, when they find the right number of pixels, they save that to a database.

Works great now!