try this.
You can use the WebBrowser control to do so. It will allow you to show HTML inside your WinForms.
The DocumentText proprety will allow you to set a String that represent the HTML you want to show.
For example:
webBrowser.DocumentText = "<html><body><p>I like StackOverflow</p><body></html>";
Afterward if you want to print the page, you'll have to wait until the Document is completed and call the Print method of the WebBrowser. MSDN shows an easy way to do it:
private void PrintHelpPage()
{
WebBrowser webBrowserForPrinting = new WebBrowser();
webBrowserForPrinting.DocumentCompleted +=
new WebBrowserDocumentCompletedEventHandler(PrintDocument);
webBrowserForPrinting.Url = new Uri(@"\\myshare\help.html");
}
private void PrintDocument(object sender,
WebBrowserDocumentCompletedEventArgs e)
{
((WebBrowser)sender).Print();
((WebBrowser)sender).Dispose();
}
You should also consider trying to use the method PrintDialog to 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[
^]