Search code examples
c#winformspdfwebbrowser-controladobe-reader

WebBrowser control doesn't display the Pdf file into the winform with Adobe. Why?


Here's my code to open the pdf file into the webBrowser control:

private void Form1_Load(object sender, EventArgs e)
    {
        OpenFileDialog dlg = new OpenFileDialog();
         dlg.Filter = "pdf files (*.pdf) |*.pdf;";
         dlg.ShowDialog();
         webBrowser1.Navigate(dlg.FileName);

    }

And here's my problem:

When I have Foxit Panthom like default pdf reader the pdf is displayed into the webBrowser, but when I set Adobe Reader (I try even with Sumatra Pdf) to default pdf reader the pdf file is displayed into a separated window. Why? Where I'm wrong?

I'm working with a Windows 7 Professional 32 bit.


Solution

  • It stopped working for us too after upgrading to Adobe Acrobat Reader DC. Following the instruction in Adobe Help Center - Display PDF in browser is ok for us now.

    Switch off and then on again.