Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to control browser widget to print
How to control browser widget to print [message #457924] Thu, 07 July 2005 07:08 Go to next message
karl is currently offline karlFriend
Messages: 1
Registered: July 2009
Junior Member
Hi,all:
Use browser widget can navigate internet,but how to control the browser
widget to print the content of browser widget?
Thanks a lot.
Re: How to control browser widget to print [message #457937 is a reply to message #457924] Thu, 07 July 2005 20:18 Go to previous messageGo to next message
Benjamin Pasero is currently offline Benjamin PaseroFriend
Messages: 337
Registered: July 2009
Senior Member
karl wrote:

> Hi,all:
> Use browser widget can navigate internet,but how to control the
> browser widget to print the content of browser widget?
> Thanks a lot.

You can execute JavaScript on the Browser. For example
Browser.execute(window.print())

Ben
Re: How to control browser widget to print [message #459760 is a reply to message #457937] Mon, 15 August 2005 19:22 Go to previous messageGo to next message
John Huss is currently offline John HussFriend
Messages: 3
Registered: July 2009
Junior Member
This works for me on Windows, but on other platforms I have problems.

On Mac OS X (10.3.9) the execute function returns true but does
nothing--no dialog, no printed page. But if I just open up safari and
run the JavaScript directly from a page, it correctly opens a print
dialog and prints.

On Linux (Mandrake LE2005) a print dialog always appears, but it isn't
initialized correctly. If I run the Javascript directly from Mozilla it
gives a print dialog with my default printer name shown (like
"PostScript/Lexmark 3200"), but in my SWT app, the print dialog usually
shows "PostScript/default" and will not print. At other times, the
print dialog is completely void of information and also won't print.
Directly in Mozilla (1.6) it works fine, but from SWT I can't get it to
work.

Do you have any suggestions or explanations why this is so? I would
really like to be able to print HTML from an SWT app on all of these
platforms.

-John



On Thu, 2005-07-07 at 21:18 +0100, Benjamin Pasero wrote:
> karl wrote:
>
> > Hi,all:
> > Use browser widget can navigate internet,but how to control the
> > browser widget to print the content of browser widget?
> > Thanks a lot.
>
> You can execute JavaScript on the Browser. For example
> Browser.execute(window.print())
>
> Ben
Re: How to control browser widget to print [message #459769 is a reply to message #459760] Tue, 16 August 2005 07:32 Go to previous message
Benjamin Pasero is currently offline Benjamin PaseroFriend
Messages: 337
Registered: July 2009
Senior Member
Known Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=92471

Please vote / comment.

Ben
> This works for me on Windows, but on other platforms I have problems.
>
> On Mac OS X (10.3.9) the execute function returns true but does
> nothing--no dialog, no printed page. But if I just open up safari and
> run the JavaScript directly from a page, it correctly opens a print
> dialog and prints.
>
> On Linux (Mandrake LE2005) a print dialog always appears, but it isn't
> initialized correctly. If I run the Javascript directly from Mozilla it
> gives a print dialog with my default printer name shown (like
> "PostScript/Lexmark 3200"), but in my SWT app, the print dialog usually
> shows "PostScript/default" and will not print. At other times, the
> print dialog is completely void of information and also won't print.
> Directly in Mozilla (1.6) it works fine, but from SWT I can't get it to
> work.
>
> Do you have any suggestions or explanations why this is so? I would
> really like to be able to print HTML from an SWT app on all of these
> platforms.
>
> -John
>
>
>
> On Thu, 2005-07-07 at 21:18 +0100, Benjamin Pasero wrote:
>
>> karl wrote:
>>
>>
>>> Hi,all:
>>> Use browser widget can navigate internet,but how to control the
>>> browser widget to print the content of browser widget?
>>> Thanks a lot.
>>>
>> You can execute JavaScript on the Browser. For example
>> Browser.execute(window.print())
>>
>> Ben
>>
>
>
Previous Topic:SWT Advocacy
Next Topic:WizardDialog Questions
Goto Forum:
  


Current Time: Sat Apr 10 23:21:03 GMT 2021

Powered by FUDForum. Page generated in 0.01896 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top