Home » Eclipse Projects » Standard Widget Toolkit (SWT) » PDF Problem with SWT Browser on Linux/GTK SWT 3.1.1 w/ Mozilla
PDF Problem with SWT Browser on Linux/GTK SWT 3.1.1 w/ Mozilla [message #466157] |
Wed, 04 January 2006 01:29 |
Joe Mihalich Messages: 25 Registered: July 2009 |
Junior Member |
|
|
Hi,
We're having a problem displaying pdf files from and SWT Browser
class in Mozilla on Suse Linux with SWT 3.1.1.
When I launch Mozilla standalone, and navigate to the page that
embeds the pdf, it works fine. A dialog popups asking me if I want
to open it with acrobat, or save the file.
When I navigate to the page inside an swt browser class,
I immediately get the file save-as dialog...it doesn't give me the
option of opening it in acrobat. If I save the file, it winds up
saving a valid pdf file which I can open in acrobat.
Am I doing something wrong, or could this be a bug
in SWT? In our case, the url I set is actually to a normal html page.
then if you
click on a button on the page, it hits our server, which
returns a pdf response
Here is basically what I'm doing....
final Shell shell = new Shell();
shell.setText(windowTitle);
shell.setLayout(new FillLayout());
shell.setMaximized(true);
Composite comp = new Composite(shell, SWT.NONE);
comp.setLayout(new FillLayout());
Browser browser = new Browser(comp, SWT.NONE);
browser.addOpenWindowListener(new OpenWindowListener()
{
public void open(WindowEvent event)
{
Shell shell = new Shell(getMainShell().getDisplay());
shell.setText("");
shell.setLayout(new FillLayout());
Browser browserNew = new Browser(shell, SWT.NONE);
//add window open/close listeners here (removed for brevity
sake)
event.browser = browserNew;
}
});
browser.addCloseWindowListener(new CloseWindowListener()
{
public void close(WindowEvent event)
{
Browser browserNew = (Browser)event.widget;
Shell shell = browserNew.getShell();
shell.close();
}
});
browser.setUrl(url);
shell.open();
Thanks,
Joe
|
|
| |
Re: PDF Problem with SWT Browser on Linux/GTK SWT 3.1.1 w/ Mozilla [message #466159 is a reply to message #466157] |
Wed, 04 January 2006 02:39 |
Haris Peco Messages: 1072 Registered: July 2009 |
Senior Member |
|
|
Joe,
I think that you have two versions mozilla
pdf view work fine when you have pdf plugin for mozilla
- you have plugin when launch mozilla standalone, but no when call swt
browser
it is possible that you have user-based plugin for mozilla
(in .mozilla/plugins) and it isn't used when you call from swt
workaround : check pdf plugin for mozilla in MOZILLA_FIVE_HOME/plugins
peco
Joe Mihalich wrote:
>
> Hi,
>
> We're having a problem displaying pdf files from and SWT Browser
> class in Mozilla on Suse Linux with SWT 3.1.1.
>
> When I launch Mozilla standalone, and navigate to the page that
> embeds the pdf, it works fine. A dialog popups asking me if I want
> to open it with acrobat, or save the file.
>
> When I navigate to the page inside an swt browser class,
> I immediately get the file save-as dialog...it doesn't give me the
> option of opening it in acrobat. If I save the file, it winds up
> saving a valid pdf file which I can open in acrobat.
>
> Am I doing something wrong, or could this be a bug
> in SWT? In our case, the url I set is actually to a normal html page.
> then if you
> click on a button on the page, it hits our server, which
> returns a pdf response
>
> Here is basically what I'm doing....
>
> final Shell shell = new Shell();
> shell.setText(windowTitle);
> shell.setLayout(new FillLayout());
> shell.setMaximized(true);
>
> Composite comp = new Composite(shell, SWT.NONE);
> comp.setLayout(new FillLayout());
>
> Browser browser = new Browser(comp, SWT.NONE);
>
> browser.addOpenWindowListener(new OpenWindowListener()
> {
> public void open(WindowEvent event)
> {
> Shell shell = new Shell(getMainShell().getDisplay());
> shell.setText("");
> shell.setLayout(new FillLayout());
> Browser browserNew = new Browser(shell, SWT.NONE);
> //add window open/close listeners here (removed for brevity
> sake)
> event.browser = browserNew;
> }
> });
>
> browser.addCloseWindowListener(new CloseWindowListener()
> {
> public void close(WindowEvent event)
> {
> Browser browserNew = (Browser)event.widget;
> Shell shell = browserNew.getShell();
> shell.close();
> }
> });
>
> browser.setUrl(url);
> shell.open();
>
> Thanks,
> Joe
|
|
| | | | | | | |
Re: PDF Problem with SWT Browser on Linux/GTK SWT 3.1.1 w/ Mozilla [message #466277 is a reply to message #466271] |
Thu, 05 January 2006 21:01 |
Haris Peco Messages: 1072 Registered: July 2009 |
Senior Member |
|
|
Joe,
it is simple - you have to find mozilla install which eclipse use
and plugin have to exists in MOZILLA_FIVE_HOME/plugins
if you have mozilla nad firefox it is two mozilla install
(firefox is mozilla without mail, irc,news,composer etc - it is same
libraries) - you eclipse use firefox , maybe
add nppdf.so to FIREFOX_HOME/plugins, too
try make new user and start standalone mozilla and check pdf plugin
(without install plugin for this user)
you can see plugins with link about:plugins (in swt browser , too)
- check this link standalone and in swt browser and you will see different
swt browser is complete same like standalone mozilla
Joe Mihalich wrote:
>
> Hi,
>
> When I remove the plugin from the mozilla directory,
> standalone still works due to the mozilla plugin scanning
> feature. See here:
>
> http://plugindoc.mozdev.org/faqs/acroread.html#install-linux
>
> There is only 1 mozilla installed on this box. We also
> have firefox installed but that's in a different directory, and
> nothing points there.
>
> Any other ideas?
>
> Joe
|
|
| |
Goto Forum:
Current Time: Thu Dec 26 12:02:54 GMT 2024
Powered by FUDForum. Page generated in 0.03961 seconds
|