Hi, Help needed for printing a text file in dos mode from vb.net

rtsviswa

New member
Joined
Sep 14, 2007
Messages
4
Programming Experience
1-3
can any one help me to find a solution for printing a preformatted text in dos mode.

regards,
viswa:)
 
All .NET printing is done using a PrintDocument. You call its Print method and handle its PrintPage event. In the PrintPage event you use the e.Graphics property to draw whatever you want printed using GDI+. In your case you could get the text by calling File.ReadAllText and then pass it to e.Graphics.DrawString.
 
You don't need an example from me. Go to the MSDN library and read the documentation for the PrintDocument class, which will include at least one code example plus plenty of explanation. If you don't understand it all, then you should ask more questions but you'll have a more specific idea of what you don't know. If you want help the first thing you should do is read the Help, then look elsewhere if you're still in need.

Also, I'm willing to bet that there are numerous examples already posted on the forum if you care to search.
 
Back
Top