[.net] How can I hide the Adobe Reader toolbar when displaying a PDF in the .NET WebBrowser control?

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.

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.

My code to load the PDF file is as follows:

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

Adobe Reader toolbar that I wish to hide

This question is related to .net pdf webbrowser-control acrobat adobe-reader

The answer is


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.

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:

   Adobe Reader Preferences dialog

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:

   Adobe Reader Read Mode toolbar button

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:

#toolbar=0&navpanes=0

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);

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


Examples related to .net

You must add a reference to assembly 'netstandard, Version=2.0.0.0 How to use Bootstrap 4 in ASP.NET Core No authenticationScheme was specified, and there was no DefaultChallengeScheme found with default authentification and custom authorization .net Core 2.0 - Package was restored using .NetFramework 4.6.1 instead of target framework .netCore 2.0. The package may not be fully compatible Update .NET web service to use TLS 1.2 EF Core add-migration Build Failed What is the difference between .NET Core and .NET Standard Class Library project types? Visual Studio 2017 - Could not load file or assembly 'System.Runtime, Version=4.1.0.0' or one of its dependencies Nuget connection attempt failed "Unable to load the service index for source" Token based authentication in Web API without any user interface

Examples related to pdf

ImageMagick security policy 'PDF' blocking conversion How to extract table as text from the PDF using Python? Extract a page from a pdf as a jpeg How can I read pdf in python? Generating a PDF file from React Components Extract Data from PDF and Add to Worksheet How to extract text from a PDF file? How to download PDF automatically using js? Download pdf file using jquery ajax Generate PDF from HTML using pdfMake in Angularjs

Examples related to webbrowser-control

Options for embedding Chromium instead of IE WebBrowser control with WPF/C# Use latest version of Internet Explorer in the webbrowser control Difference between F5, Ctrl + F5 and click on refresh button? Load local HTML file in a C# WebBrowser Will the IE9 WebBrowser Control Support all of IE9's features, including SVG? How can I hide the Adobe Reader toolbar when displaying a PDF in the .NET WebBrowser control? How to wait until WebBrowser is completely loaded in VB.NET? Detect WebBrowser complete page loading Disable JavaScript error in WebBrowser control Replacing .NET WebBrowser control with a better browser, like Chrome?

Examples related to acrobat

Documentation for using JavaScript code inside a PDF file Adobe Acrobat Pro make all pages the same dimension How can I hide the Adobe Reader toolbar when displaying a PDF in the .NET WebBrowser control? Display Adobe pdf inside a div Adobe Reader Command Line Reference

Examples related to adobe-reader

PDF files do not open in Internet Explorer with Adobe Reader 10.0 - users get an empty gray screen. How can I fix this for my users? How can I hide the Adobe Reader toolbar when displaying a PDF in the .NET WebBrowser control? Adobe Reader Command Line Reference