How to set webbrowser media type to print in C #?

In webbrowser control I want to set media type = print. Thus, it will display the content in preview mode. Is this possible and how to do it?

0


a source to share


3 answers


The only solution seems to be redirecting the request to another server which will fetch the original page and change the css attributes to display the print layout on the screen. This can be done by removing the screen css files and setting the media = "print" attribute to media = "screen".



0


a source


In google chrome (I'm using version 33 now) you can open developer tools with F12and then click Esc. in the "Emulation" tab you can set CSS media

to print

.



0


a source


Simulate print preview using CSS by setting the print media property -

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

      

Dynamically Generating a Preview Page in ASP.NET

Dynamically Generating a Preview Page in ASP.NET

http://www.eggheadcafe.com/community/aspnet/2/10083542/open-the-print-preview-di.aspx

-1


a source







All Articles