How to print a web page make in GWT

754 views
Skip to first unread message

ri60

unread,
Jan 17, 2008, 5:48:36 PM1/17/08
to Google Web Toolkit
I have an application developed in GWT. When attempt to print using
File -> Print from IE6 prints the components and the data to me but
without an apparent order. Obtaining an ugly impression, sometimes
ilegible.
Any ideas? What's wrong?

Peter Blazejewicz

unread,
Jan 19, 2008, 8:46:13 AM1/19/08
to Google Web Toolkit
hi,

printing in browsers usually force develoeprs to use two custom
things:
- printer-friendly content
- printer-context .css
for example your compnents can be used to create printout content
which is styled with other .css
see for example that thread:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/c1eadffb3877b16d/
you can use Andre's solution to put data to be printed into separate
iFrame and print it,

regards,
Peter

ri60

unread,
Jan 22, 2008, 1:27:03 PM1/22/08
to Google Web Toolkit
Thanks for the answer. I'veen tried with Andre's Solution, i can print
a widget or full page, now the problem is that the prints dont show
style's... color, borders, etc ... i'venn tried with :

Print.it("<link rel='StyleSheet' type='text/css' media='paper'
href='Estilo.css'>",someFlexTable);

I need to use @media print and @media screen too? or i need two css
files?

Some ideas?



On 19 ene, 07:46, Peter Blazejewicz <peter.blazejew...@gmail.com>
wrote:
> hi,
>
> printing in browsers usually force develoeprs to use two custom
> things:
> - printer-friendly content
> - printer-context .css
> for example your compnents can be used to create printout content
> which is styled with other .css
> see for example that thread:http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...

Andre Freller

unread,
Jan 22, 2008, 1:52:25 PM1/22/08
to Google-We...@googlegroups.com
 
Your have to remove the ' chars from the style string:
 
<link rel=StyleSheet type=text/css href=mystyle.css>
 
Regards,
Freller

Ian Bambury

unread,
Jan 22, 2008, 4:29:54 PM1/22/08
to Google-We...@googlegroups.com
In IE - Tools - Internet Options - Advanced - Printing/Print Background Colors And Images
 
In FF - File - Page Setup - Format & Options - Print Background (colors and images) 
 
There's nothing you can do in code to override the user's preferences and waste their ink :-(
 
Ian

 
> > Any ideas? What's wrong? http://examples.roughian.com

Andre Freller

unread,
Jan 23, 2008, 10:09:21 AM1/23/08
to Google-We...@googlegroups.com
 
Hi Ian,
 
That is related only to background colors and images. If you don't remove the quotations marks when sending styles to Print.it the CSS is not used at all. I'm still trying to deal with this problem programmatically.
 
Regards,
Freller

ri60

unread,
Jan 23, 2008, 12:02:32 PM1/23/08
to Google Web Toolkit
Hi Andre:

Your solution works perfectly! thank you...

But I still similar problem... when im try'ng to print a
VerticalSplitPanel for example, with one FlexTable for each side.
If I print the flextable's separately i got a good print with styles ,
but if I print the whole verticalSplitPanel i got a bad print whitout
styles.... i can´t do that? or what?

Anotherr thing.... on the top side of the split panel i have some
ListBox's... when i print the whole splitpanel didn't print the really
selectedindex, always prints the string with the index = 0 as
selectedindex....


On Jan 22, 12:52 pm, "Andre Freller" <andre.frel...@gmail.com> wrote:
> Your have to remove the ' chars from the style string:
>
> <link rel=StyleSheet type=text/css href=mystyle.css>
>
> Regards,
> Freller
>
Message has been deleted

Andre Freller

unread,
Jan 29, 2008, 7:39:10 AM1/29/08
to Google-We...@googlegroups.com

Hi Rigo,

The problem may reside on the fact that I use the toString function to produce the html in the printing hidden iframe. I think the toString implementations of thees two widgets are producing different output than the actual view. I'll have to check that...

Regards,
Frell


On 1/23/08, ri60 <rigo.tl...@gmail.com> wrote:

Hi Andre:

Your solution works perfectly! thank you...

But I still similar problem... when im try'ng to print a
VerticalSplitPanel for example, with one FlexTable for each side.
If I print the flextable's separately i got a good print with styles ,
but if I print the whole verticalSplitPanel i got a bad print whitout
styles.... i can´t do that? or what?

Anotherr thing.... on the top side of the split panel i have some
ListBox's... when i print the whole splitpanel didn't print the really
selectedindex, always prints the string with the index = 0 as
selectedindex....


On Jan 22, 12:52 pm, "Andre Freller" <andre.frel...@gmail.com> wrote:
> Your have to remove the ' chars from the style string:
>
> <link rel=StyleSheet type=text/css href=mystyle.css>
>
> Regards,
> Freller
>

ri60

unread,
Jan 31, 2008, 7:20:38 PM1/31/08
to Google Web Toolkit
Hi Andre:

Ok.. I will wait your new version ;)

thank you


On 29 ene, 06:39, "Andre Freller" <andre.frel...@gmail.com> wrote:
> Hi Rigo,
>
> The problem may reside on the fact that I use the toString function to
> produce the html in the printing hidden iframe. I think the toString
> implementations of thees two widgets are producing different output than the
> actual view. I'll have to check that...
>
> Regards,
> Frell
>
Reply all
Reply to author
Forward
Message has been deleted
0 new messages