in reply to Win32 Printing
use strict; use LWP::Simple; use Win32::GuiTest qw( WaitWindowLike SetForegroundWindow SendKeys + ); my $url = q(http://www.cnn.com); my $fn = $ENV{TEMP}."\\test.html"; getstore ($url, $fn); my $prg = qq(start rundll32 mshtml.dll,PrintHTML "$fn"); system $prg; $_ = WaitWindowLike( 0, qr/Apply/i, undef , undef, undef, 10000) +; SetForegroundWindow($_); SendKeys ("{ENTER}"); print "Printed ",-s $fn, " bytes from $url";
Switches to mshtml.dll
%1 - File to print
%2 - Printer-name
%3 - Printer driver
%4 - Printer port
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Win32 Printing
by BrowserUk (Patriarch) on Nov 04, 2004 at 00:20 UTC | |
by ldln (Pilgrim) on Nov 04, 2004 at 06:04 UTC | |
by BrowserUk (Patriarch) on Nov 04, 2004 at 06:57 UTC |