views:

265

answers:

1

Hi all,

We would like to print the Web page loaded onto WebBrowser control in C# .net application.We have custom printer driver to print the bitmap images, now our task is to get the printer friendly version of web pages by applying print media CSS style to webBrowser control.

Do you know the method /code to get the Printer friendly version of any html web page in C# .net application.

Thanks, Ramanand Bhat.

+1  A: 

When you style your print stylesheet, call it in the <head> like this:

<link rel="stylesheet" type="text/css" media="print" href="print.css" />

When the user requests a print, the print.css is called. No C# necessary. When you form your print stylesheet, think "print"; take out coloring, reformat any positioning that will bring anything "off the page", etc. Here's one resource I use for print stylesheets:

http://www.webcredible.co.uk/user-friendly-resources/css/print-stylesheet.shtml

tahdhaze09