Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

How to print to a printer?

by Anonymous Monk
on May 31, 2000 at 08:06 UTC ( [id://15576]=perlquestion: print w/replies, xml ) Need Help??

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

How to print to a printer?

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: How to print to a printer?
by chromatic (Archbishop) on Jun 06, 2000 at 03:19 UTC

    On UNIX, you'd open a pipe to lpr. That will handle spooling and queueing for you.

    Under Windows, there's probably a Win32:: module to get at the printer spooler.

      Can you please expalin it in more detail. I did not understand exactly how does this work
Re: How to print to a printer?
by schweini (Friar) on Feb 15, 2003 at 10:05 UTC

    On Windows, you can use

    open( PRN, "> LPT1")
    or
    open( PRN, "> //printserver/printershare" )
    which is quite useful. The only problem is that you can't check when your printer's buffer is full.

      That obviously won't work on anything but windows-based systems. On unix systems, you'll most likely either want to pipe into lpr(1) or lp(1); as an alternative, a platform independent interface like the Printer module could be used.

      --
      mowgli

Re: Printing to a printer
by schweini (Friar) on Feb 15, 2003 at 10:08 UTC
    ARG!
    (dunno how to edit answers, so here's my correction)
    there should, of course, only be ONE backslash between the SMB server and the sharename. sorry.

    Originally posted as a Categorized Answer.

Re: Printing to a printer
by Anonymous Monk on Jan 06, 2002 at 17:56 UTC
    Please write the Perl code for printing to a printer. Thanks.

    Originally posted as a Categorized Answer.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-03-29 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found