473,626 Members | 3,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3020
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
5214
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 problem. Have you ever wanted to use print to a file using the System.Drawing.Printing namespace only to find out that the only way to do it is by popping a dialog box through the PrintDialog? What if you want to print to file without user...
3
705
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 is DefaultPrinter, it is set to false when I know that I have that printer set as default (I verify via the "Printers and Fax" applet Can anyone confirm or explain TIA
5
2212
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 "compile the questions" into a theoretical problem to see what people think should be done to solve it. Maybe it will be a worthwhile discussion, but more importantly maybe it will find out the very best way to sort this kind of problem out so that...
16
48863
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 a commercial program such as Adobe Acrobat and its associated API. The technique uses Ghostscript and Redirection Port Monitor - two free programs for creating PDF documents provided free by Russell Lang. The actual automation requires VBA...
2
4078
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 have the printer print a line that relates to what the event was. From what I can see of the printer model in .Net, it's mostly document based. Is there any way to have it print a single line to the printer (and have the printer actually output...
4
9233
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 this differences increases with the increase number of labels. The code is as follwods: Here rdr = OleDbDataReader Font is Times New Roman, 12pt
3
6291
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 computer has drivers installed for this printer, and this printer is shared for the network. Question 1:
0
5751
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 added the 7 as subreports so they can print one after the other. I'm supposed to be printing them from a VB.Net 2003 application and I will be passing 2 parameters (start and end dates). These reports are huge (over 1000+ pages each). My original...
18
11288
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 classes, for each of the checked rows in the GridView. This works fine in the Visual Studio 2005 development environment on localhost. But, when I move the page to the web server, I get the error "Settings to access printer...
0
8203
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8711
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8368
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5576
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4094
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1515
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.