Text only line printer

T

Tony

I'm writing a virtual terminal that needs to print credit card receips to a
text-only line printer. I do not see in the .NET framework a way to print
to non-graphics printers. Does anyone one know how this is done?

Thanks,
Tony
 
D

Dick Grier

Hi,

Is this installed as a standard Windows printer (Generic Text Only)? If so,
then you don't need to do anything special.

It this is not installed as a standard printer, then the way that might do
this depends how you are physically connected to the printer.

If this is a serial printer, then you can simply use any one of the several
serial IO classes or ActiveX controls for this purpose (for example, the
class in my book or NETComm.ocx from my homepage) -- there are a number of
other classes that may be downloaded.

If a parallel printer, then the only way that I know that works is to use a
device driver that accesses the parallel port directly, bypassing the
Windows API. I have created an ActiveX control that provides the API for
this, and porting it to .NET codes should be fairly easy.

It would seem like you might be able to get CreateFile to open LPT1 (for
example), and perhaps you can, but I haven't done it. All of the serial
classes use CreateFile to open the port (COM1, for example), so simply
substituting the printer port name "should" work.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top