views:

139

answers:

3

Hi there,

We are using a client application to print out grade sheets from an online application.

This has been working flawlessly until the systems were upgraded to IE 8. I now receive this error (Access Denied): http://img707.imageshack.us/img707/5259/62270489.png
Apparently, this is a known issue and it cannot be solved.

How can I print HTML from a WinForms application without using the IE WebBrowser control?

Thanks,

Martin Wiboe

A: 

This "might" work: If you are using Office Automation and the html is basic enough, you could make a request the html and print via word?

Another Idea worth exploring:

Convert the Html content to PDF and save/print that.

Mark Redman
Good idea, but Office is not necessarily installed on the machines.
Martin Wiboe
Yeah, there are a few known requirements to that solution...
Mark Redman
PDF conversion seems to be my only option. I was thinking of using wkhtmltopdf - any thoughts?
Martin Wiboe
A: 

hmm interesting error, I've seen this before, I suggest you using Gecko.

Some References:

Embedding Gecko(Mozilla rendering engine) in a .Net application

GeckoFX is a Windows Forms control written in clean, commented C# that embeds the Mozilla Gecko browser control in any Windows Forms Application. It also contains a simple class model providing access to the HTML and CSS DOM.

Lukas Šalkauskas
After trying Gecko, it appears that it does not have a method for printing :( I will probably try and go the PDF way instead.
Martin Wiboe
A: 

As idea if you use ASP: http://dotnet.fast-report.com/Default.aspx

Report exports to html (for preview) and (by own controls) export to PDF for printing. So you will receive "browser rendering independed" solution.

Merl
Thanks, but I'll probably prefer an open source solution though.
Martin Wiboe