Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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.
thanks,

-schweini

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.

    /J\

Re: printing to a spooler under windows
by ikegami (Pope) 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2020-03-29 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    To "Disagree to disagree" means to:









    Results (171 votes). Check out past polls.

    Notices?