473,395 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Printing to a printer

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
2 2985
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: BJS | last post by:
Sorry for the cross-posting, but based on the number of people I have seen ask for a solution to this problem, I hope by cross-posting this, that it will help a lot of people out of a common...
3
by: RBisch | last post by:
I am finding that some of the properties off of the PrinterSettings object are misleading For example, When I test the CanDuplex on a printer I know duplexes, the property is false. Another one...
5
by: Mark Preston | last post by:
Admission first - I don't actually have a problem here but have noticed that a lot of people have been asking similar questions and getting very varied answers. What I've done is to sort of...
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
2
by: Ryan Gregg | last post by:
I'm working on a project where I need to be able to print a single line at a time to a dot matrix printer. Essentially we have a log printer and each time an event occurs on the system I need to...
4
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And...
3
by: Mika M | last post by:
Hi all! I have made an application for printing simple barcode labels using PrintDocument object, and it's working fine. Barcode printer that I use is attached to the computer, and this...
0
by: John Smith | last post by:
Hello, I have 7 different crystal reports that need to be collated. Since I want to end up with a page of each (which all together make a single report), I created a blank main report and then...
18
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.