如何以编程方式启用/禁用“中显示PDF在浏览器中”有关的Acrobat / Reader的XI或DC配用的Adobe ActiveX控件 [英] How To Programmatically Enable/Disable 'Display PDF In Browser' For Acrobat / Reader XI or DC For Use With Adobe ActiveX Control

查看:2230
本文介绍了如何以编程方式启用/禁用“中显示PDF在浏览器中”有关的Acrobat / Reader的XI或DC配用的Adobe ActiveX控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个.NET的C#应用​​程序,使得使用的Adobe的ActiveX控件。对于版本均使用Adobe Acrobat和Adobe Reader 7-10,使用这种控制你需要打开显示PDF在浏览器的设置。您可以手动从GUI使用做到这一点

We have a .NET C# application that makes use of the Adobe ActiveX Controls. For versions 7-10 of both Adobe Acrobat and Adobe Reader, to use this control you were required to turn on the "Display PDF In Browser" setting. You could do this manually from the GUI using

Preferences > Internet > Display PDFs in browser

或编程通过直接设置注册表设置

or programmatically by setting the registry settings directly

HKEY_CURRENT_USER\Software\Adobe\(Product Name)\(Version)\Originals
"bBrowserIntegration"=dword:00000001

随后的SDK参考<一href="http://www.adobe.com/devnet-docs/acrobatetk/tools/$p$pfRef/Windows/Originals.html#BrowserIntegration">http://www.adobe.com/devnet-docs/acrobatetk/tools/$p$pfRef/Windows/Originals.html#BrowserIntegration.我们的应用程序已经使用编程方式设置此注册表值时,我们的客户能够版本的Adobe Reader或Adobe Acrobat 7-10。上面还链接表明,该 bBrowserIntegration 注册表项pcated在十一(11)日$ P $。旧的注册表路径仍然存在,在新的版本,即:

Which follows the SDK reference http://www.adobe.com/devnet-docs/acrobatetk/tools/PrefRef/Windows/Originals.html#BrowserIntegration. Our application has been using the programmatically setting of this registry value when our customers have versions 7-10 of Adobe Reader or Adobe Acrobat. The link above also indicates that this bBrowserIntegration registry key is deprecated in XI (11). The old registry path still exists in the new versions, i.e.:

HKEY_CURRENT_USER\Software\Adobe\(Product Name)\(Version)\Originals

但有不再是 bBrowserIntegration 键就像文档指出,这是德precated。

however there is no longer a bBrowserIntegration key just as the documentation indicates, it is deprecated.

这确实出现了的Adobe ActiveX控件仍然被启用,因为它总是只要工作得很好用XI和DC在浏览器中显示PDF。

It does appear that the Adobe ActiveX Control still works just fine with XI and DC as long as Display PDF in Browser is enabled, as it always has.

有关版本第十一章(11)和DC,有两个公布的链接,清楚地表明如何实现这个手动

For versions XI (11) and DC, there are two published links that clearly show how to achieve this manually:

XI (11): https://helpx.adobe.com/acrobat/11/using/display-pdf-browser-acrobat-xi.html
DC (current): https://helpx.adobe.com/acrobat/using/display-pdf-in-browser.html

在测试Adobe Reader的DC,如果我们不完成的步骤,以便在浏览器中显示PDF为新客户安装的,那么我们的应用程序将引发一个 COM错误然后,如果我们能按照上面的链接说明一切都将按预期与我们的应用程序的设置,它呈现使用Adobe ActiveX控件,它类似于我们所期望看到在旧版本的PDF文件(7-10)在未设置注册表设置(见我的旧帖子和我自己的解决方案,当时<一个href="http://stackoverflow.com/questions/2526301/how-to-diagnose-cause-fix-or-work-around-adobe-activex-com-related-error-0x8/2561962#2561962">How诊断原因,修复,或解决的Adobe的ActiveX / COM相关的错误0x80004005 progmatically?)。

When testing Adobe Reader DC, if we don't complete the steps to enable the Display PDF in Browser for a new customer installation, then our application will throw a COM error and then if we enable the setting following the instructions in the link above, everything works as expected with our application, it renders PDFs using the Adobe ActiveX Control, which is similar to what we expect to see in older versions (7-10) when the registry setting was not set (see my old post and my own solution back then How to diagnose cause, fix, or work around Adobe ActiveX / COM related error 0x80004005 progmatically?).

所以,问题仍然存在,什么是预期的纲领性相当于无论是在XI或直流今天或相当于7-10通过设置​​注册表设置什么工作的手工工艺 bBrowserIntegration 相应。我们希望能够打开它,然后将其重新设置为previous设置时,我们的应用程序结束(所以我们的应用程序不会强制用户保存设定,只是因为我们的应用程序需要它),这是我们做什么今天为7-10。

So, the question remains, what is the expected programmatic equivalent either for the manual process in XI or DC today or the equivalent to what worked in 7-10 by setting the registry setting bBrowserIntegration accordingly. We want to be able to turn it on and then reset it to the previous setting when our application ends (so our application doesn't force the user to keep the setting just because our application needs it) which is what we do today for 7-10.

我似乎无法找到任何引用网上如何启用从开发人员的角度来看/禁用浏览器的集成,这样我们的应用程序可以继续使用的ActiveX控件,而不是有COM的错误出现,迫使用户改变这种手工操作。

I can't seem to find any references online for how to enable/disable browser integration from a developer standpoint so our application can continue to the use the ActiveX Control and not have the COM errors show up, forcing the user to change this manually.

主要任务是了解该解决方案的 DC 作为这种重新presents新范式安装Adobe Acrobat / Reader的。

The primary priority is to understand the solution for DC as this represents the new paradigm for Adobe Acrobat/Reader.

推荐答案

你有没有考虑使用的注册免费的情况?它允许没有在全球注册的ActiveX使用COM / ActiveX组件的应用程序,并允许您的应用程序加载的隔离COM / ActiveX控件为您的应用程序仅基于在XML清单定义的接口包括沿。

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.

请参阅<一href="http://stackoverflow.com/questions/465882/generate-manifest-files-for-registration-free-com">this帖子的工具列表和这个帖子的示例XML清单使用Flash插件,这一步步骤指南。我认为对Adobe Reader的控制,你应该使用的 PDF.ocx 的距离的 C:\ Program Files文件\的Adobe \ Acrobat中\读卡器\的ActiveX 的文件夹

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.

更新(2015年7月27日):在Adobe Reader的最新版本,他们使用AcroPDF.dll和感动成\ Program Files文件\ Common Files文件\的Adobe \ Acrobat中\的ActiveX \,因为我已经使用Adobe Reader 11检查可惜尝试使用Regsvr32.exe安装它的时候AcroPDF.dll抛出错误。我想它会检查一些额外的钥匙初始化非许可使用,以保护(直到用户疏导在IE控件)之前。好像没有办法正式和编程走动要求用户明确允许PDF控制通过非Adobe应用程序使用。

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.

另请参阅讨论有关在x64平台上可能出现的问题:更好,更可靠的方法是使用Adobe Reader的控制间接地通过主办IE的WebBrowser控件,将相应地调用内置的PDF阅读器的控制。

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.

这篇关于如何以编程方式启用/禁用“中显示PDF在浏览器中”有关的Acrobat / Reader的XI或DC配用的Adobe ActiveX控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆