CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2006
    Posts
    28

    Directly write to network printer

    Hi all,

    I ran into a problem. How do I write raw data directly to the network printer.

    Thanks in advance.

    Regards.

  2. #2
    Join Date
    Apr 2009
    Posts
    598

    Smile Re: Directly write to network printer

    It depends on your kind of printer and network.

    First, place your data in a file, e.g. foo.dat.

    Sometimes, the printer can be reached from Windows command/console box (cmd.exe or command.com).
    The printer's address is in the form \\pathofnetwrok\nameofprinter.
    Write "type foo.dat >\\pathofnetwrok\nameofprinter".

    Sometimes, the printer can be reached via FTP.
    Open a connection using the IP address of the printer.
    Issue a "put foo.dat" command to send the file to the printer.

  3. #3
    Join Date
    Dec 2008
    Posts
    114

    Re: Directly write to network printer

    See MSDN code sample to write raw data to printer .

  4. #4
    Join Date
    Sep 2009
    Posts
    19

    Re: Directly write to network printer

    It depends on the type of the printer. I only recently discovered that there is an lpr.exe program in Windows (at least XP; probably w2k; NT4?, W9x??). How to do it from a program see attached files.

    Johannes
    Attached Files Attached Files

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

Featured