How do I print an HTML string so that all HTML tags are recognized and displayed correctly? I suppose it's possible to create an .HTML file and print it, but if there is a way to do this without creating additional files, I would be interested to know how to do it. Thank!
Application:
pd.PrintPage += new PrintPageEventHandler(PrintDocument_PrintPage);
pd.Print();
More code:
static private void PrintDocument_PrintPage(Object sender, PrintPageEventArgs e) {
Font printFont = new Font("Courier New", 12);
e.Graphics.DrawString("<b>Hello</b> world", printFont, Brushes.Black, 0, 0);
}
Printed Result:
<b>Hello</b> world
source
share