Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Using IE to render html

by alien_life_form (Pilgrim)
on May 08, 2002 at 13:46 UTC ( [id://165028]=CUFP: print w/replies, xml ) Need Help??

On Win32, the omni-{present,vorous} explorer control is a convenient way to render html on the fly. This is easy if you write it to a file - however doing it directly from a string requires some non-obvious component manipulation...
use Win32::OLE; # standard IE manipulation my $ie=Win32::OLE->new('InternetExplorer.Application'); die('Creating explorer window: ' . Win32::OLE->LastError()) unless $ie; # make visible $ie->{Visible}=1; # hide a lot of UI stuff $ie->{AddressBar} = $ie->{ToolBar} = $ie->{StatusBar} = $ie->{MenuBar} = 0; # force the creation of the document object $ie->Navigate2('about:'); # this is not directly creatable. my $doc=$ie->document(); die('Creating explorer document: ' . Win32::OLE->LastError()) unless $doc; $doc->write('<html><head></head><body><h1>Cool</h1></body></html>'); sleep(1) while $ie->{Busy}; # if jscript is involved... #$ie->Refresh(); # Shows jscript but crashes ie...why? #...carry on...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-04-19 13:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found