?
Solved

Sending a textfile to the printer

Posted on 2006-04-17
3
Medium Priority
?
186 Views
Last Modified: 2010-04-16
Hi,

I need to print a few lines of text, and am loking for an easy way to do this.  So I thought it would be easiest if I simply wrote wht I need to a textfile, then sent the file to the printer.

Can anyone explain an easy way to do this?


Thanks,
Bob
0
Comment
Question by:ba272
3 Comments
 
LVL 12

Accepted Solution

by:
sumix earned 1200 total points
ID: 16471712
Indeed there are lots of articles that shows you how to print a file using PrintDocument class, DrawString method of Graphics class or API functions ..
  See MSDN help for PrintDocument class, or
    http://www.codeproject.com/csharp/multipadprintdocument.asp 
    http://www.c-sharpcorner.com/Code/2002/Oct/PrintDirect.asp

  But if you only want to send a file to the printer you can run a OS 'copy' command:

System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo("copy " + filename + " prn:"));
      Instead of PRN: you can also use a port name where a printer is conected (LPT1:)



0
 
LVL 10

Assisted Solution

by:SystemExpert
SystemExpert earned 800 total points
ID: 16475135
Hi,

This is for raw printing for dotmatrix
hope it will work for you

http://www.knowdotnet.com/articles/cprintreportstringdemocs.html

Thanks
0
 

Author Comment

by:ba272
ID: 16475145
actually, it's a thermal strip printer.  I don't think I'd know where to buy a dot matrix even if I wanted one!

I'm sure there is value in your link though.  So thanks,

Bob
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question