[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[platform-swt-dev] SWT HTML Printing
|
Printing an OleSite
The pb
Hi... I tried to use the simplest SWT API to print an HTML document:
controlSite.exec(OLE.OLECMDID_OPEN, OLE.OLECMDEXECOPT_DONTPROMPTUSER, new
Variant( "someURL" ), null );
and
controlSite.exec( OLE.OLECMDID_PRINT, OLE.OLECMDEXECOPT_PROMPTUSER, null,
null );
It doesn't work (doesn't load the page and doesn't print).
Does anyone know why? It's a bug?
So I tried again in another way:
OleAutomation automation = new OleAutomation(controlSite);
int[] rgdispid = automation.getIDsOfNames(new String[]{"Navigate"});
int dispIdMember = rgdispid[0];
Variant[] rgvarg = new Variant[1]; // this is the URL parameter
rgvarg[0] = new Variant("someURL");
Variant pVarResult = automation.invoke(dispIdMember, rgvarg);
It works. But I was searching for 4 hours on MSDN, Google and Eclipse pages
and I can't find a solution to print with OleAutomation like I did to load
the page.
this code
automation.getIDsOfNames(new String[]{"Print"});
returns null because the method Print is not recognized by the WebBroser
Object.
see:
http://msdn.microsoft.com/workshop/browser/webbrowser/reference/objects/webb
rowser.asp
If someone know how to print an HTML file, please explain here.
Sorry for my English and Thnx, Edu.
--
POP. Nem parece internet grátis.
Seja POP você também!
Acesse: http://www.pop.com.br/pop_discador.php e baixe o POPdiscador.