问题
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