Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Ole + Acrobat = NPE
Ole + Acrobat = NPE [message #458954] Wed, 27 July 2005 10:19 Go to next message
Thomas Bielagk is currently offline Thomas BielagkFriend
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 Go to previous messageGo to next message
Kalman Hazins is currently offline Kalman HazinsFriend
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 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
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
Previous Topic:[REPOST] Maybe List control bug ?
Next Topic:Detecting impending app minimization
Goto Forum:
  


Current Time: Thu Apr 25 16:42:25 GMT 2024

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

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

Back to the top