July 2011 - Posts

Printing using Window.Print and CSS

Ok perhaps this is a bit old. but worthed to be noted.

at first thought would like to print using the telerik reporting print preview.

but You could print using the regular HTML and defined own CSS applied only when printed.

to print simply call window.print();

the next question is , how can we defined and add css which is only when printed .

simple case i don't want my print image button being printed.

the answer is by using your own css. just specify the media="print" not "screen"

this will told browser the css for printing is that one.

there you can set your #printbutton{ display:none }

you could set the Font of each element etc, do more, example is like the blueprint css framework, the Print.css

Share this post: | | | |
Posted by cipto with no comments