On 03/08/2011 05:39 PM, Rob Tanner wrote: > Hi, > > Found a great little class to enable me to print the contents of > panels. Here's the URL: > http://gwt-commons-sandbox.googlecode.com > /svn/branches/freller/gwt-commons/src/org/gwtcommons/user/ > client/Print.java > > I'm printing the contents of a HorizontalPanel() that contains an > HTML() object that contains the text of a policy that the user is > required to agree to follow. There is no requirement that they keep a > hard copy, but I've added a print in case they do. The printed output > is identical to the panel but the problem I have is that the full > HTML() object is longer than a single letter size page (it's displayed > inside a ScrollPanel() in the browser) so the text that overflows on > to the second page of the printout appears about a quarter of an inch > down from the physical top of the paper. Is there any way I can > control the top and bottom margins on the multiple printed pages? > > Thanks, > > Rob Tanner > Linfield College >
Hi Rob: The browser gets to decide how to format the page. You can try various CSS media tricks. I'm assuming you've seen at least http://www.w3.org/TR/CSS2/media.html If not, that's a good place to examine the print media type. You can probably do something with the requirement text by enclosing it in a div with small text and narrow margins, combined with a set of instructions to the user that explain how to set the margins. There will inevitably be annoying edge cases. Generate a PDF if you want complete control of the page layout. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.