|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Print from console applicationI am trying to make my program send a page to a printer from my console application. I want to print the content of a string variable. I have tried the following to print from a text file: Dim myPrint as New PrintDocument myPrint.DocumentName="C:\temp\MyTextDocument.txt" myPrint.Print This works, but the printed page is blank. However - what I really need is to print a text string (several lines). Any ideas? best regards Frank On 5/30/2010 8:04 AM, Frank GTL wrote:
Show quoteHide quote > Hi Printing works the same in .Net, whether it is from a console app or > I am trying to make my program send a page to a printer from my console > application. > I want to print the content of a string variable. > > I have tried the following to print from a text file: > > Dim myPrint as New PrintDocument > myPrint.DocumentName="C:\temp\MyTextDocument.txt" > myPrint.Print > > This works, but the printed page is blank. > > However - what I really need is to print a text string (several lines). > > Any ideas? > > > best regards > Frank > > from a windows forms app. Try the example at http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx. It's a bit more involved than you have shown. -- Mike Am 30.05.2010 14:04, schrieb Frank GTL:
> I am trying to make my program send a page to a printer from my console Handle the 'PrintDocument' object's 'PrintPage' event and send the text > application. > I want to print the content of a string variable. > > I have tried the following to print from a text file: > > Dim myPrint as New PrintDocument > myPrint.DocumentName="C:\temp\MyTextDocument.txt" > myPrint.Print > > This works, but the printed page is blank. > > However - what I really need is to print a text string (several lines). to the printer there using 'e.Graphics.DrawString(...)'. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
DataGridView values.
How to use Serial Port Component bindingSource.Position = ... doesn't change the current property. need help looping through string of names connect bindingSource to text object. priority queue Serialization problem vb.net 2008 professional version question best solution When is pinning required? |
|||||||||||||||||||||||