views:

515

answers:

2

I've have an app that is a xml/xslt driven document viewer. In its current state, a user points their own browser to the xml file and can view the pdf files from menu selections in their browser so long as they have a PDF viewer plugin such as Adobe Reader installed on their machine.

Using the .NET webbrowser control, I was able to create a small little app of my own that renders the document viewer (the interface, etc) great so I can remove the need for the user to use their own browser. I'd like to take this a step further and remove the need for the user to have the pdf viewer plugin installed on their system and just be able to include the plugin either rolled into the .exe I ship or have it dependent on a locally provided .dll for the plugin.

I've worked before with portable apps (i.e. Firefox) and I know this is possible to have the the portable firefox app use a plugin dll provided in the same directory structure as the portable app.

Is there a way to do this either by forcing the webbrowser control (essentially an instance of IE) reference a locally provided dll for the plugin or by embedded in the plugin somehow?

Thanks for any input.

A: 

Contact the plugin's author to see if you can legally redistribute the plugin first. Then ask if the webbrowser control is supported by the plugin. Most likely the plugin is written as an ActiveX Document Server that is not designed for the webbrowser control but if the plugin is written property (that is, not using hacks and undocumented behavior specific to IE) it should work.

You can also write your own Activex document server to handle the PDF files navigation, but it is a lot of work even with MFC's ActiveX document server support. Or you can write a XBAP/Silverlight/Flash based viewer that displays the XML and only convert to PDF when the client want to print/download.

Sheng Jiang 蒋晟
The plugin is the same plugin you would use in IE. It is not a server, rather just a pdf viewer. It works just fine in the app using the webbrowser control when the plugin is installed on the user's system. The question I am asking really is about how to make webbrowercontrol (or IE) make use of a plugin (it is just a dll) from a specific directory location instead of looking only at the system default location for plugins.At this point, I am not sure what having a server would bring to the table for this since it all works fine as a web page browsing selected pdf files from the file system.
Streamline
Perhaps the piece I forgot to mention earlier was that this tool / app is for viewing locally residing pdf files, not downloading files over the internet to view.
Streamline
An ActiveX Document Server is a COM component, usually exported from a DLL. Contact the plugin's author to find out redistribute options. Nobody else know if the plugin loads some other DLL once in a blue moon that may also need to be deployed.
Sheng Jiang 蒋晟
A: 

Perhaps this question should be asked another way since the WebBrowser Control really is a wrapper around an instance of Internet Explorer...

How can you tell Internet Explorer to use a plugin that resides in a specific directory location other than the host machine's default plugin location? That way I would makes sure the PDF Reader plugin being used was the one I want it to use and not the host machine's plugin.

Any one know how to do this?

Streamline
I've come across another reason to need this actually. I discovered a problem if the user has Adobe Acrobat installed since IE appears to want to use a plugin from Acrobat instead of the one for Adobe Reader even if in Internet Options it specifies to use the Reader plugin. Does anyone know how to specifically tell IE or the WebBrowser Control which plugin to use for loading PDF files and can it be a plugin from a specified directory?
Streamline