0

I'm working on c#.net application that already use serial port to print ticket with text and a little image as logo by thermal printer.

Now i need to migrate the implementation to allow application to print through Parallel Port because the hardware is changed...

For serial port (COM1...COMN) i used ESC/POS command..

is it possible continue to use ESC/POS and redirect the print to parrallel?..

exist documentation?..

i found many doc to print text only . what i have to do to print image?

thanks

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
  • Checkout the PrintServer, PrintQueue & PrintDialog classes. You could create the ticket as a form & use the classes to print that with any images you require. http://www.samnoble.co.uk/2011/02/27/net-printing-made-easy-part-1-introduction/ – PaulF Aug 27 '15 at 15:57

1 Answers1

0

.NET abstracts printing from the printer, so the code is the same regardless of whether the printer is serial, on the network, connected via parallel port, or connected via bluetooth. To print an image, you would use the DrawImage method of the Graphics object--more detail can be found on MSDN.

Whether the printer is on parallel port or serial port is a function of how the printer is defined in Windows, and is not important to .NET.

However, if you are resorting to sending raw escape sequences and bypassing the use of a printer driver (such as referenced by ESC/POS), then you are making a whole world of extra work for yourself, and you'll need to refer to the printer's technical documentation for how to do what you ask.

Russ
  • 4,091
  • 21
  • 32