Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Printing with a Win32 printer

by mdog (Pilgrim)
on Nov 27, 2001 at 05:06 UTC ( [id://127684]=perlquestion: print w/replies, xml ) Need Help??

mdog has asked for the wisdom of the Perl Monks concerning the following question:

OK...So I need to be able send a print request from a Win32 box to a printer hooked up to Win32 network.

I need to be able to do this via perl or even a utility that I could call via a system call. A quick scan of the available Win32 modules has yielded nothing so far and the same goes for perl monks.

It looks like someone else had this question:
http://www.perlmonks.org/index.pl?node_id=24739&lastnode_id=864
but never got a workable answer.

Anybody know of a way?

mdog

I'm off to scour the Internet to see if there is any pertinent info.

Replies are listed 'Best First'.
Re: Printing with a Win32 printer
by traveler (Parson) on Nov 27, 2001 at 05:43 UTC
    I just used this code:
    open PRINTER, ">//SERVER/PRINTER"; while(<>){ print PRINTER $_; }
    where SERVER is the name of the computer with the printer and PRINTER is the name of the printer (s/k/a "sharename"). The program above is the "poor person's lpr" :-).

    HTH, --traveler

Re: Printing with a Win32 printer
by osfameron (Hermit) on Nov 27, 2001 at 05:10 UTC
    I think print /d:\\server\printer filename from the Win32 command line should do for text documents.

    Cheerio!
    Osfameron

      Just found an alternative answer as well:

      From the command line:
      lpr -S 10.0.0.1 -P JD_WEB_HP5SI test.txt:

      Thanks!

Re: Printing with a Win32 printer
by Anonymous Monk on Apr 24, 2004 at 15:59 UTC
    Hi, Coul some one help me on how I can install network printers using perl script? I need to be able to install many printers on win2k printer server. HAdam

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://127684]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-18 05:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found