Results 1 to 5 of 5

Thread: text to printer

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    122

    text to printer

    Hi all ,

    can anyone show their insight how to send . txt file to a printer that got an IP adddress

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: text to printer

    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:
    1. Printer.Print "This is some text"
    2. Printer.EndDoc

  3. #3
    Fanatic Member Comintern's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln, NE
    Posts
    826

    Re: text to printer

    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
    Last edited by Comintern; Mar 17th, 2005 at 03:57 PM. Reason: Fix typo

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    122

    Re: text to printer

    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

  5. #5
    Fanatic Member Comintern's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln, NE
    Posts
    826

    Re: text to printer

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width