How To Programmatically Enable/Disable 'Display PDF In Browser' For Acrobat / Reader XI or DC For Use With Adobe ActiveX Control

江枫思渺然 提交于 2019-12-05 01:45:22
Eugene

Have you considered the use of "Registration free" scenario? It allows to use COM/ActiveX components in your application without registering the ActiveX globally and allows to load the isolated COM/ActiveX control for your application only based on the interfaces defined in the XML manifest included along with your application.

See this post for the list of tools and this post for sample XML manifest to use Flash plugin and this step by step guide. I assume that for Adobe Reader control you should use PDF.ocx from C:\Program Files\Adobe\Acrobat \Reader\ActiveX folder.

UPDATE (July 27 2015): In the latest versions of Adobe Reader they use AcroPDF.dll and moved it into \Program Files\Common Files\Adobe\Acrobat\ActiveX\ as I've checked with Adobe Reader 11. Unfortunately AcroPDF.dll throws error when trying to install it using regsvr32.exe. I suppose it checks some additional keys before initializing to protect from non permitted use (until user unblocks the control in IE). Seems like there is not way officially and programmatically walk around the requirement for user to explicitly permit PDF control for use by non-Adobe apps.

Also see the discussion regarding possible issues on x64 platform: the better and more reliable way is to use Adobe Reader control indirectly by hosting IE’s WebBrowser control that will invoke the embedded PDF viewer control accordingly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!