Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

printing to a spooler under windows

by schweini (Friar)
on Aug 19, 2004 at 19:28 UTC ( #384423=perlquestion: print w/replies, xml ) Need Help??

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

hi, all.

anybody know how to make windows print raw-text via the spooler instead of using the cludgy open(PRN, "> COM1")?
this "open" method is a PITA since it doesn't keep track of printer-buffers, whether the printer is switched on, etc.
a quick search turned up some nodes, but no real solution like open(PRN, "|lpr") on unix.


Replies are listed 'Best First'.
Re: printing to a spooler under windows
by gellyfish (Monsignor) on Aug 20, 2004 at 09:12 UTC

    One solution is to create and share a printer on the appropriate windows machine and then open it with:

    open PRINTER ,'>\\\\machinename\\printername' or die "No printer :$!\n";
    This should use the print service on the machine that the share is setup on.


Re: printing to a spooler under windows
by ikegami (Patriarch) on Aug 19, 2004 at 22:07 UTC
    If you can find what API call to use, you can use Win32::API to call it
Re: printing to a spooler under windows
by PodMaster (Abbot) on Aug 20, 2004 at 03:40 UTC
    Try Printer maybe?

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2022-01-20 03:06 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (56 votes). Check out past polls.