Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

I am just starting out with printing in VB.Net.

I have had a look around and seem to find a lot of information around System.Drawing.Printing which I have played around with. But I can not figure out how to pass a string to that to print. Something as simple as:

dim Text as String = "This is test text"

System.Drawing.Printing.(PrintText) "I know printtext is not a function" = Text
System.Drawing.Printing.Print()

Am I looking in the wrong spot to do what I want to do, System.Drawing.Printing only seems to support printing out a file that already exists.

Thanks,

Caz
Posted

I found this[^] with google.
 
Share this answer
 
Comments
Zac Newman 31-Jul-12 1:17am    
Thanks for confirming what I was doing, after a heap of time wasted I figured out that it was .Net not wanting to play with shared printers which was leading to my issues.
You will need to research the PrintDocument. The PrintDocument object has a PrintPage event that you handle and has a graphics object that you can draw text, shapes, images on.

http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument(v=vs.71).aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900