in reply to Re^2: Printing from a browser
in thread Printing from a browser

Hi,

Got

$IE = Win32::OLE->new("InternetExplorer.Application") || die "Could not start Internet Explorer.Application\n";

$IE->{visible} = 1;

$URL = "http://news.bbc.co.uk";

$IE->Navigate($URL);

all of which works just fine. But... what's the one to send the page directly to the printer...? Anyone know?

Thanks, David.

Replies are listed 'Best First'.
Re^4: Printing from a browser
by shmem (Chancellor) on May 21, 2007 at 20:44 UTC
    in your OP (original post) you wrote:
    I want to be able to fetch a web page, save it in a file, render it in a browser and then print the rendered version.

    I can do the first 3 bits (LWP::Simple etc) but can't think how to get the rendered page to go straight to the printer.

    but your code example only passes a URL to the browser, not the file you've got with LWP::Simple. So no modification is applied. The browser gets the page directly from the source, no printing code in it. Maybe you want to modify the retrieved webpage, store it to a file and point the browser to that file.

    Another possibility is to set up a local proxy (see HTTP::Proxy) that retrieves the page on behalf of your browser, modifies it on the fly and serves it to your browser. You'd have to tell your browser to use that proxy.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}