I’m doing a C# project that should have a feature of printing HTML pages. I used WebBrowser control’s Print() function. Confusingly, the function strips CSS styles from the HTML page while printing! Can you please tell me an alternative solution that prints HTML page along with CSS styles?
Share
As none of the answers helped me, I tried hard finding out the actual problem. Now, I can figure out what actually is wrong.
The problem is with my Internet Explorer’s page setting! Don’t get it? Okay, let me explain it. Microsoft .NET’s WebBrowser class just wraps the unmanaged Internet Explorer’s functionality to form a managed version. So, if anything was wrong in IE, it would also affect the WebBrowser class.
In my case, my Internet Explorer’s ‘page setting’ was not configured to print out background colors and images. All I gotta do is to just click the check box which is labelled as ‘Print Background Colors and Images’. That’s it! 🙂 Now, my application happily prints out the HTML page with CSS styles!
Anyways, I thank all the three guys who tried to help me.