Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Printing from Perl in Windows

by grantm (Parson)
on Feb 17, 2003 at 20:44 UTC ( #236114=note: print w/replies, xml ) Need Help??


in reply to Printing from Perl in Windows

Further to my HTML suggestion (above), I've poked around in the windows explorer 'File Types' dialog and discovered that you can print an HTML document from the command line using this command:

"C:\Program Files\Microsoft Office\Office\msohtmed.exe" /p filename.html

When you run that, an MS Word window appears, opens the file, prints it and exits. So obviously this option assumes you have Word.

On a machine without MS Office installed, I found this command associated with the HTML Print action:

rundll32.exe C:\WINNT\System32\mshtml.dll,PrintHTML filename.html

I found that this command only worked if the filename was an absolute pathname (perhaps a URL would work too). It had the advantage of using the fonts defined in the HTML/CSS, which the Word command did not. It had the disadvantage of popping up a print dialog which you have to click OK on - there may be some way to automate that.

Replies are listed 'Best First'.
Re: Re: Printing from Perl in Windows
by John M. Dlugosz (Monsignor) on Feb 18, 2003 at 22:27 UTC
    Hmm, very nice. HTML is easy to generate, but I'd need to figure out enough style stuff to get the sizes right.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2020-12-02 18:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (44 votes). Check out past polls.

    Notices?