Hi all ,
can anyone show their insight how to send . txt file to a printer that got an IP adddress
Printable View
Hi all ,
can anyone show their insight how to send . txt file to a printer that got an IP adddress
Do you mean that it is attached to a different computer, or does it have a print server box connected to the lan? For my printer, I select it from my computer (I have a wireless laptop and print to the desktop printer) the computer (by ip address) and then the printer name. Then, I can print directly to it from VB.
VB Code:
Printer.Print "This is some text" Printer.EndDoc
The easiest way would be to install it's printer driver and use it like any other Windows printer. The more complicated way would be to implement an LPR system through Winsock TCP. You can find the protocol specification here:
http://www.brooksnet.com/faq/rfc1179.html
the one iam working are wrapper printers ... iam trying to network the printers ( printer 1 thru printer 5 and has got IP addresses associated with each one of them)and send customized text file which had got message data and text. iam trying to develop a VB code.. can anyone tell me the best way of doing this. If yes in VB ,, can anyone post sample code.
thanks in advance
It's possible, but is definately not a trivial task. The easy part is using a Winsock control to connect to the printer via TCP. The hard part is figuring out how to format the output. If the printers are post-script printers, that might not be too hard. Just create a local printer that prints to PS files (HP driver would be a good bet.) and grab the output file. Then write it to the socket that you've opened along with the appropriate control codes from the LPR specification. If you aren't comfortable with doing your own raw socket writes, I'd try to find appropriate printer drivers to use and let Windows do the work. You could also look into using IPP or print through HTTP if you will be using IIS. This page has more infomation:
http://www.microsoft.com/technet/pro.../contchov.mspx