Skip to main content



      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 03:08 Go to next message
Eclipse UserFriend
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 16:18 Go to previous messageGo to next message
Eclipse UserFriend
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 15:22 Go to previous messageGo to next message
Eclipse UserFriend
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 03:32 Go to previous message
Eclipse UserFriend
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: Fri Jul 04 15:04:50 EDT 2025

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

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

Back to the top