title: Displaying a local PDF file in WPF with WebBrowser-Control
body: <p>I'm trying to display a local PDF file in a WebBrowser-Control. I didn't want to use the Adobe-Libraries, because they don't support 64-bit. Now I already have the code to display a PDF, but only if it is not on the local HDD. When I right-clicked on the WebBrowser-Control and displayed the SourceCode of the HTML, I saved it as an HTML-File to check, if the HTML-Code is correctly working. Well, it works.</p>
  
  <p>My window only consists of a maximized WebControl. I think the problem are the Security Settings of the local Internet Explorer. I read that a custom IInternetSecurityManager could solve the problem, but I don't know how to implement it... :/</p>
  
  <p>I'm using C# with .NET Framework 4.0</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    void MainWindow_Loaded(object sender, RoutedEventArgs e)
      {            
          string url = "C:/test.pdf";
          string html = "&lt;!-- saved from url=(0014)about:internet --&gt;\n&lt;html&gt;\n&lt;body&gt;\n&lt;embed src=\"" + url + "\" width=\"100%\" height=\"100%\"/&gt;\n&lt;/body&gt;\n&lt;/html&gt;";
          webBrowser.NavigateToString(html); // System.Windows.Controls.WebBrowser
      }
  </code></pre>
  
  <p>I the "saved from URL" part does only work if I directly open the HTML-Code in IE, so please tell me what to do, to get this code work... Maybe you have a better solution for my problem. Thanks for your help!</p>
  
  <p>Regards,
  Chris</p>