Ole + Acrobat = NPE [message #458954] |
Wed, 27 July 2005 10:19 |
Thomas Bielagk Messages: 1 Registered: July 2009 |
Junior Member |
|
|
Hi,
I'm trying to control Adobe Acrobat (V.6 or higher), and i want it to show
up in its own window.
Using the following code this works fine so far:
File f = new File("c:\\test.pdf");
Display display = new Display();
Shell shell = new Shell(display);
OleFrame frame = new OleFrame(shell,SWT.NONE);
OleClientSite site = new OleClientSite(frame,SWT.NONE,f);
site.doVerb(OLE.OLEIVERB_SHOW);
But when i now try to set up the Automation Object, just like
OleAutomation auto = new OleAutomation(site);
I get a NullPointerException inside SWT:
Exception in thread "main" java.lang.NullPointerException
at org.eclipse.swt.ole.win32.OleAutomation.<ini
(OleAutomation.java:114)
at Adobe.main(Adobe.java:38)
I checked if site might be null but it isn't (doVerb works so this
shouldn't be the case).
Any idea on this?
Besides, if I try
OleControlSite site = new OleControlSite(frame,SWT.NONE,"PDF.PdfCtrl.6");
instead everthing is fine, but Adobe shows up in my Shell and this turns
out to be rather slow.
Thanks,
Thomas
|
|
|
Re: Ole + Acrobat = NPE [message #459019 is a reply to message #458954] |
Thu, 28 July 2005 15:01 |
Kalman Hazins Messages: 76 Registered: July 2009 |
Member |
|
|
Thomas,
I would personally just display the pdf in the browser and forget about it.
You can find tutorials on the browser widget as well as pdf viewer on
http://www.zikal.com/
Thanx,
- Kalman
"Thomas Bielagk" <thomasbielagk@gmx.de> wrote in message
news:Xns96A07D5D58CC4thomasbielagkgmxde@206.191.52.34...
> Hi,
> I'm trying to control Adobe Acrobat (V.6 or higher), and i want it to show
> up in its own window.
> Using the following code this works fine so far:
>
> File f = new File("c:\\test.pdf");
>
> Display display = new Display();
> Shell shell = new Shell(display);
>
> OleFrame frame = new OleFrame(shell,SWT.NONE);
> OleClientSite site = new OleClientSite(frame,SWT.NONE,f);
>
> site.doVerb(OLE.OLEIVERB_SHOW);
>
> But when i now try to set up the Automation Object, just like
>
> OleAutomation auto = new OleAutomation(site);
>
> I get a NullPointerException inside SWT:
>
> Exception in thread "main" java.lang.NullPointerException
> at org.eclipse.swt.ole.win32.OleAutomation.<ini
> (OleAutomation.java:114)
> at Adobe.main(Adobe.java:38)
>
> I checked if site might be null but it isn't (doVerb works so this
> shouldn't be the case).
>
> Any idea on this?
>
> Besides, if I try
>
> OleControlSite site = new OleControlSite(frame,SWT.NONE,"PDF.PdfCtrl.6");
>
> instead everthing is fine, but Adobe shows up in my Shell and this turns
> out to be rather slow.
>
> Thanks,
>
> Thomas
|
|
|
Re: Ole + Acrobat = NPE [message #459161 is a reply to message #458954] |
Tue, 02 August 2005 19:08 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
Please enter a bug report.
"Thomas Bielagk" <thomasbielagk@gmx.de> wrote in message
news:Xns96A07D5D58CC4thomasbielagkgmxde@206.191.52.34...
> Hi,
> I'm trying to control Adobe Acrobat (V.6 or higher), and i want it to show
> up in its own window.
> Using the following code this works fine so far:
>
> File f = new File("c:\\test.pdf");
>
> Display display = new Display();
> Shell shell = new Shell(display);
>
> OleFrame frame = new OleFrame(shell,SWT.NONE);
> OleClientSite site = new OleClientSite(frame,SWT.NONE,f);
>
> site.doVerb(OLE.OLEIVERB_SHOW);
>
> But when i now try to set up the Automation Object, just like
>
> OleAutomation auto = new OleAutomation(site);
>
> I get a NullPointerException inside SWT:
>
> Exception in thread "main" java.lang.NullPointerException
> at org.eclipse.swt.ole.win32.OleAutomation.<ini
> (OleAutomation.java:114)
> at Adobe.main(Adobe.java:38)
>
> I checked if site might be null but it isn't (doVerb works so this
> shouldn't be the case).
>
> Any idea on this?
>
> Besides, if I try
>
> OleControlSite site = new
OleControlSite(frame,SWT.NONE,"PDF.PdfCtrl.6");
>
> instead everthing is fine, but Adobe shows up in my Shell and this turns
> out to be rather slow.
>
> Thanks,
>
> Thomas
|
|
|
Powered by
FUDForum. Page generated in 0.03579 seconds