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