I am developing a windows application using vb.net, I have a simple html page with place holders in it, I load the page into a stream reader, replace the place holders and then I need to print the html content, anybody have any idea how to print the html content as html and not source.
P.S. code in vb.bet or c# is ok.
Thanks
I am developing a windows application using vb.net, I have a simple html page
Share
You can use the
WebBrowsercontrol to do so. It will allow you to show HTML inside yourWinForms.The DocumentText proprety will allow you to set a String that represent the HTML you want to show.
For example:
Afterward if you want to print the page, you’ll have to wait until the Document is completed and call the
Printmethod of theWebBrowser. MSDN shows an easy way to do it:You should also consider trying to use the method
PrintDialogto make sure the issue is not your printing configuration.Here is the link to MSDN:
Print with a WebBrowser control on MSDN
Possible duplicate:
Printing WebBrowser control content