How can I set print margins? - my content is cut off when printed out

I've designed my web pages to fit within the 800x600 resolution.

Upon printing out a page on my printer, I was surprised to find that the content gets cut off.

Its obvious that the margins are, by the printers default, set to too large of a value, because there was room to spare on the sheet.

I'm designing my site to be "user friendly", so for the pages that need to be printed out, they will have to fit on the page properly, and I can't expect the user to go into the page setup and set the printers default margins to a smaller value.

So what do I do?

Are there some java classes available that can set the margins for a page?

Will the users printer accept the margins?

Please provide any info you can...point me in the right direction, please.

My web pages are constructed by using html, java, servlets, and jsp.

So the java code will be in a servlet should this process require it.

[960 byte] By [Love2Javaa] at [2007-11-26 20:28:57]
# 1

The printing happens on the browser. So there's nothing you can do on the server to affect that, except to output suitable HTML (and CSS, and Javascript). You have to deal with it on the client side. This isn't a JSP or Java question.

But it's a good thing you looked at that. You would be amazed at the number of professionally-designed web sites I have seen where printing the pages results in chopping off the right-hand side of the text.

So anyway, it's up to you to deal with it in HTML and CSS. I find that if my CSS uses relative widths (i.e. percentages) for the page then it prints just fine. But professional web designers seem to prefer fixed widths for some reason that I don't understand.

DrClapa at 2007-7-10 1:18:11 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...