Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to displaing a PDF in a plugin?
How to displaing a PDF in a plugin? [message #312731] Fri, 16 February 2007 20:28 Go to next message
Eclipse UserFriend
Originally posted by: hcurtis.xaware.com

Our help plugin has a set of PDFs that we allow the user to reference in a
menu item. Currently we reference a separate copy of the PDF outside of the
eclipse plugin folder. I would like to package the PDF's in the plugin and
then display them with the same menu item.

How do you display a PDF that resides in the Plugin's jar?
Re: How to displaing a PDF in a plugin? [message #312750 is a reply to message #312731] Mon, 19 February 2007 07:29 Go to previous messageGo to next message
Eclipse UserFriend
You can use MyPlugin.getDefault().getBundle().getEntry("/path/to/PDF")
to get a URL (and input stream) to anything file within a plugin.

You could then use FileLocator to make sure it references a file on the
file system ... FileLocator will copy it to a temp location if necessary.

Or you could package your PDFs in a help plugin, then the eclipse
internal help should serve them up ... maybe that would just default to
the platforms web browser default PDF handling.

Later,
PW
Re: How to displaing a PDF in a plugin? [message #312799 is a reply to message #312750] Tue, 20 February 2007 11:50 Go to previous message
Eclipse UserFriend
Originally posted by: hcurtis.xaware.com

I have no problem in getting the Path or URI to the PDF file within the
plugin. What I haven't found is a way to display the PDF within Eclipse. I
can create my own job and display using a system runtime, but then I'm
relying on my code being system aware. Isn't there a feature in Eclipse
that will display a PDF without me being system aware? Something similar to
the Eclipse HTML browser.

"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:erc5am$so1$2@utils.eclipse.org...
> You can use MyPlugin.getDefault().getBundle().getEntry("/path/to/PDF") to
> get a URL (and input stream) to anything file within a plugin.
>
> You could then use FileLocator to make sure it references a file on the
> file system ... FileLocator will copy it to a temp location if necessary.
>
> Or you could package your PDFs in a help plugin, then the eclipse internal
> help should serve them up ... maybe that would just default to the
> platforms web browser default PDF handling.
>
> Later,
> PW
Previous Topic:Need to find local file system path for linked output folder
Next Topic:Eclipse plugin and getting subclasses
Goto Forum:
  


Current Time: Thu Mar 13 17:20:40 EDT 2025

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

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

Back to the top