开发者

Getting Print media CSS style applyed web page in WebBrowser control in C#

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 htm开发者_运维技巧l web page in C# .net application.

Thanks, Ramanand Bhat.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜