如何隐藏的Adobe Reader的工具栏上的.NET WebBrowser控件显示一个PDF文件时? [英] How can I hide the Adobe Reader toolbar when displaying a PDF in the .NET WebBrowser control?

查看:1465
本文介绍了如何隐藏的Adobe Reader的工具栏上的.NET WebBrowser控件显示一个PDF文件时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图加载一个.NET的Web浏览器控件内部PDF文档。在Adobe Reader的前V10(又名X),在PDF没有工具栏加载的版本显示,你只看到了PDF文档。在新发布的读者V10,还有,我不希望看到一个工具栏。我想知道如果任何人知道如何隐藏此工具栏。

I am trying to load a PDF document inside a .NET web browser control. In versions of Adobe Reader prior to v10 (aka "X"), the PDF loaded without the toolbar displayed—you would just see the PDF document. In the newly-released Reader v10, there is a toolbar that I do not wish to see. I am wondering if anyone knows how to hide this toolbar.

我想,答案可能在于在注册表中,因为是我用来访问阅读器没有直接的code。一切都是由MIME类型通过 web浏览器处理控制。

I'm thinking that the answer may lie in the Registry, as there is no direct code that I am using to access Reader. Everything is handled by mime types through the WebBrowser control.

我的code加载PDF文件如下:

My code to load the PDF file is as follows:

string url = @"http://www.domain.com/file.pdf";
this._WebBrowser.Navigate(url);

推荐答案

它会出现缺省设置的Adobe Reader的X是在工具栏的没有的在默认情况下显示,除非它们被明确地打开的用户。甚至当我把他们在会议期间回,它们不会自动下一次出现。因此,我怀疑你有一个preference设置违背了默认。

It appears the default setting for Adobe Reader X is for the toolbars not to be shown by default unless they are explicitly turned on by the user. And even when I turn them back on during a session, they don't show up automatically next time. As such, I suspect you have a preference set contrary to the default.

你的愿望,与上边和左边工具栏的状态的没有的显示,被称为阅读模式。如果您对文档本身单击鼠标右键,然后单击页面显示preferences中所显示的上下文菜单中,你会psented与Adobe Reader的preferences对话框$ P $。 (这是同一个对话框,你可以通过打开的Adobe Reader应用程序,并从编辑菜单中选择preferences访问。)在preferences对话框的左侧栏中显示的列表中,选择Internet。最后,在右边,请确保您有显示在读取模式默认为框中选中:

The state you desire, with the top and left toolbars not shown, is called "Read Mode". If you right-click on the document itself, and then click "Page Display Preferences" in the context menu that is shown, you'll be presented with the Adobe Reader Preferences dialog. (This is the same dialog you can access by opening the Adobe Reader application, and selecting "Preferences" from the "Edit" menu.) In the list shown in the left-hand column of the Preferences dialog, select "Internet". Finally, on the right, ensure that you have the "Display in Read Mode by default" box checked:

   

   

您也可以关闭工具栏暂时按一下按钮,在顶部的工具栏,描绘箭头指向对角右侧:

You can also turn off the toolbars temporarily by clicking the button at the right of the top toolbar that depicts arrows pointing to opposing corners:

   

   

最后,如果你有显示在读取模式默认为关闭,但要教你加载页面的没有的显示工具栏(即覆盖用户的当前preferences),你可以添加以下的网址:

Finally, if you have "Display in Read Mode by default" turned off, but want to instruct the page you're loading not to display the toolbars (i.e., override the user's current preferences), you can append the following to the URL:

#工具栏= 0&放大器; navpanes = 0

因此​​,例如,下面的code将禁用的顶部工具栏(称为工具栏)和左侧的工具栏(称为navpane)。然而,如果用户知道键盘组合( F8 ,也许还有其他的方法为好),他们将仍然能够把它们重新打开。

So, for example, the following code will disable both the top toolbar (called "toolbar") and the left-hand toolbar (called "navpane"). However, if the user knows the keyboard combination (F8, and perhaps other methods as well), they will still be able to turn them back on.

string url = @"http://www.domain.com/file.pdf#toolbar=0&navpanes=0";
this._WebBrowser.Navigate(url);

您可以阅读更多关于可用于定制的方式PDF文件打开的这里Adobe的开发者网站

You can read more about the parameters that are available for customizing the way PDF files open here on Adobe's developer website.

这篇关于如何隐藏的Adobe Reader的工具栏上的.NET WebBrowser控件显示一个PDF文件时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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