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

Printing to a printer

P: n/a
I've got a dot matrix printer that I need to print a line at a time to.
This is being used for an audit log on an application and every event
that occurs needs to print out right as it occurs.

I've previously had this working well in a serial communication method
where I talk directly to the printer using control codes and what not.
However, it seems that the higher ups want to be able to use a network
printer or other Windows-configured printer device.

They claim that it's possible to do this, and I don't know if they're
right or not, but I can't seem to find a good way to do it in .NET.

Does anyone know if this is possible at all for Windows to do (I assume
it is because I'm sure this is something that other applications do from
time to time), and does anyone have an idea of how to do it?

Essentially I'm looking for some sort of a method where I can give it
the name or device ID of a printer and then send single lines of text to
the printer which are printed (without doing a form feed). It's alright
if it "ties up" the printer with a document that is always being
spooled/printed, because the printer will only be used for this purpose.

Thanks in advance.

Ryan
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Ryan,
I'll show my knowlege here or my ignorance of network
printers: What they are probably talking about is the old
line printers or ancient devices they saw many years
ago. I don't know of a way to use a network printer
(with a network queue) for a dedicated device, even if
you don't give anyone else rights to use it, you still
have the problem that the interface is set up to print
documents--whole documents at a time.

Now having said this, it doesn't stop you from making a
small server (socket communication), and sending
information to a server that has a printer plugged into a
port that you can control manually. You will probably
have to go down to the C/C++ level to gain access to the
printer at that low of level. (I could be wrong, I'm not
an all exhaustive reference for .Net yet)

So the answer is: is it do-able, yes! Did your bosses
ever see it in something that resembles your
environment: very little chance! Can you do it in C#:
well partly at least!

-----Original Message-----
I've got a dot matrix printer that I need to print a line at a time to. This is being used for an audit log on an application and every eventthat occurs needs to print out right as it occurs.

I've previously had this working well in a serial communication methodwhere I talk directly to the printer using control codes and what not.However, it seems that the higher ups want to be able to use a networkprinter or other Windows-configured printer device.

They claim that it's possible to do this, and I don't know if they'reright or not, but I can't seem to find a good way to do it in .NET.
Does anyone know if this is possible at all for Windows to do (I assumeit is because I'm sure this is something that other applications do fromtime to time), and does anyone have an idea of how to do it?
Essentially I'm looking for some sort of a method where I can give itthe name or device ID of a printer and then send single lines of text tothe printer which are printed (without doing a form feed). It's alrightif it "ties up" the printer with a document that is always beingspooled/printed, because the printer will only be used for this purpose.
Thanks in advance.

Ryan
.

Nov 16 '05 #2

P: n/a
Thanks for the answer. I was pretty sure it was possible, but I still
have no idea of how to go about doing it. It looks like everything in
..NET printing is pretty much strictly document-centric, which looks like
it won't be of any use for what I'm trying to do.

Previously my application worked by talking to a serial printer directly
through a class that uses WinAPI to access the serial ports. This
worked well until today when I have a printer that isn't working via the
serial port and I need to get printing out my audit log (and it's
Saturday, that figures).

I've checked the cable wiring is correct, but the printer still won't
respond, so I think the serial input on the printer may be wrong/not
functional. This leaves me with either the USB or Parallel interface on
the printer to try and use, but no easy way to access those ports for
printing.

Thanks for your time and information though.

Ryan
morgal wrote:
Ryan,
I'll show my knowlege here or my ignorance of network
printers: What they are probably talking about is the old
line printers or ancient devices they saw many years
ago. I don't know of a way to use a network printer
(with a network queue) for a dedicated device, even if
you don't give anyone else rights to use it, you still
have the problem that the interface is set up to print
documents--whole documents at a time.

Now having said this, it doesn't stop you from making a
small server (socket communication), and sending
information to a server that has a printer plugged into a
port that you can control manually. You will probably
have to go down to the C/C++ level to gain access to the
printer at that low of level. (I could be wrong, I'm not
an all exhaustive reference for .Net yet)

So the answer is: is it do-able, yes! Did your bosses
ever see it in something that resembles your
environment: very little chance! Can you do it in C#:
well partly at least!

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.