Printing an HTML document

C

C#Schroeder

I am creating a print preview screen that will take information from a
windows application and allow the user to see it as an HTML page. I
have two buttons on that page. A Save As and a Print button. I have
the Save As button working, but can't seem to get the Print button to
work. I want the user to be able to print the HTML page as they see
it, not as xml code. I am using PrintDialog and PrintDocument and
know that I need to create a PrintDocument_PrintPage control, however
I don't know what needs to go into that PrintDocument_PrintPage
contorl. If someone could point me in the right direction I would
greatly appreciate it.

Thanks
 
N

Nicholas Paldino [.NET/C# MVP]

You really don't want to go that route. If you use a PrintDocument
class instance, you will basically have to render the HTML yourself, and I
don't think you want to do that.

Rather, you will want to have Internet Explorer do it. There are two
options, one will be by loading the HTML through the WebBrowser control, the
other is to invoke IE to do it. For more information, check out the
following archived thread:

http://groups.google.com/group/micr...64de73b37a?tvc=2&q=printhtml#77fa4164de73b37a

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top