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

旧时模样 提交于 2019-12-11 11:32:14

问题


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.


回答1:


It stopped working for us too after upgrading to Adobe Acrobat Reader DC. Following the instruction in this page (in italian ;-) https://helpx.adobe.com/it/acrobat/using/display-pdf-in-browser.html ) now is ok for us.

Switch off and then on again.



来源:https://stackoverflow.com/questions/33439618/webbrowser-control-doesnt-display-the-pdf-file-into-the-winform-with-adobe-why

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