2

I already browse this question but it was not very useful: WebBrowser control page load error (or maybe I didn't catch the thing)

I use a WebBrowser to display the content of a PDF in my application (C# .NET 4.5). I try to navigate into the local URL of the file (which I can open with the explorer) with this code:

m_path = pdfDoc.CreateReportFile();
try
{
   webBrowser1.Navigate(new Uri(m_path));
}
catch (Exception e)
{
    Console.WriteLine("{0} Exception caught.", e);
}

But the navigation is always canceled, even if I try to reload the page. No exception is thrown.

What can I do?

Here's the URL: C:\\Users\\me\\AppData\\Local\\Temp\\LY20_2014-11-25_06#22M1[1].pdf

If I paste it in IE, remove the escaping \, the file does open.

Update:

  • The webbrowser works fine when entering the string @"http://www.google.fr"
  • When using the PDF file address it opens it in Acrobat Reader after the Navigation Canceled message
Community
  • 1
  • 1
Thomas Ayoub
  • 28,235
  • 15
  • 95
  • 135

1 Answers1

0

Thanks to dear Adobe and Microsoft, we can't display a 32bits ActiveX in a 64bits WebBrowser at least, they are honest :

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Thomas Ayoub
  • 28,235
  • 15
  • 95
  • 135