By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,870 Members | 1,855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,870 IT Pros & Developers. It's quick & easy.

Printing with Dot Matrix Printer by C#?

P: n/a
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...
Dec 16 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Adam Right" <ad**@right.comwrote in message news:e2**************@TK2MSFTNGP03.phx.gbl...
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.
Dec 16 '06 #2

P: n/a
JR
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

"Willy Denoyette [MVP]" <wi*************@telenet.bewrote in message
news:Ot**************@TK2MSFTNGP03.phx.gbl...
"Adam Right" <ad**@right.comwrote in message
news:e2**************@TK2MSFTNGP03.phx.gbl...
>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.


Dec 16 '06 #3

P: n/a
"Adam Right" <ad**@right.comwrote in message
news:e2**************@TK2MSFTNGP03.phx.gbl...
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
Dec 20 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.