Reputation: 1157
I am working in a desktop project in C# with .net. This project has a function that generates some information and i would like to print this generated info as a document (may be .doc, .pdf, etc). Summarizing, i need:
I thought generating an .html file (because it's simple to generate this kind of file), but i couldn't find a way to print it directly from my program.
Which extension of file would you recommend to insert this kind of information and print it directly from my program??
Thanks in advance.
Upvotes: 0
Views: 1133
Reputation: 9776
Directly? Open printer port...
Or you can do it with framework classes:
How to: Print with a WebBrowser Control http://msdn.microsoft.com/en-us/library/b0wes9a3.aspx
Upvotes: 0
Reputation: 89232
Here's an easy way that uses a RichTextBox
http://www.codeproject.com/KB/printing/simpleprintingcs.aspx
It's not trivial to print a PDF, HTML, or a doc unless you are going to use external programs or third-party libraries. ImageMagick/GhostScript could help you print PDF.
Disclaimer: I work at Atalasoft -- If you are willing to use commercial software, my company makes PDF rendering components for .NET. There are companies that do the same for HTML.
Upvotes: 1