Printing with Dot Matrix Printer by C#?

  • Thread starter Thread starter Adam Right
  • Start date Start date
A

Adam Right

Hi,

Anyone knows how to print with dot matrix printer ? I want to print text
with some formatting such as bold, underlined font, and landscape document
etc... How can i do this with C#? Thanks...
 
Adam Right said:
Hi,

Anyone knows how to print with dot matrix printer ? I want to print text with some
formatting such as bold, underlined font, and landscape document etc... How can i do this
with C#? Thanks...

One option is to bypass the spooler and printer driver, that means you have to open the raw
device (say lpt1:) using CreateFile (through PInvoke) and the System.IO classes to write
directly to the device, don't forget that you are in charge of all the initialization stuff
otherwise done by the driver.

Willy.
 
You could attach it to a com port and use the SerialPort. No p/invoke.

The printer documentation will explain how to control the printer - fonts,
bold, etc.

JR
 
Adam Right said:
Hi,

Anyone knows how to print with dot matrix printer ? I want to print text
with some formatting such as bold, underlined font, and landscape document
etc... How can i do this with C#? Thanks...

Note that many dot-matrix printers are supported by a Windows driver, and
can be printed to in exactly the same way as any other printer. This
includes being able to print whatever font you want, with bold or
underlining, as well as choosing paper orientation.

Before you head off messing around with essentially reinventing a relatively
limited wheel, you might double-check to make sure there's no Windows
printer driver you can use for the printer you want to print on (and also
note that since early dot-matrix printers often shared a graphical command
language, you may even be able to use a generic printer driver that supports
the printer you have mind).

Pete
 
Back
Top