title: Displaying a PDF in a WPF Application Not Working - WebBrowser or Adobe Control
body: <p>I need to display a PDF in a WPF application.  From all the reading I've been doing online, it seems the [only?] ways of displaying a PDF within a WPF application is via Adobe's controls or a WebBrowser control. I've tried to use Adobe's controls, however, I have been unable to add the Reader control because for some reason I can't find the it as something I can add into my Toolbox (even once adding the reference needed). I'm running Windows 7 (64-bit), VS2010, .NET 4.0, and have Adobe Acrobat 7.0 Professional and Adobe Acrobat 9 Pro Extended installed, if that has anything to do with it.  So anyway, I decided to try it in a WebBrowser control hosted in a WindowsFormsHost. The XAML I have is this:       </p>
  
  <pre><code>&lt;WindowsFormsHost x:Name="FormsHost" Visibility="Visible" Grid.Column="1" Margin="7,0,0,0"&gt;
  &lt;WF:WebBrowser x:Name="WebBrowser" Dock="Fill" IsWebBrowserContextMenuEnabled="False" ScriptErrorsSuppressed="True" WebBrowserShortcutsEnabled="False" Margin="7,0,0,0" /&gt;
  &lt;/WindowsFormsHost&gt;
  </code></pre>
  
  <p>and then this in the C# code behind:</p>
  
  <pre><code>WebBrowser.Navigate(new System.Uri(FileName));
  </code></pre>
  
  <p>where FileName == the exact location of the .pdf file I need to display. However, when I run this all I see is a completely blank, white area where the WebBrowser is. I've also tried setting the .pdf file like this:</p>
  
  <pre><code>WebBrowser.Url = new System.Uri(FileName);
  </code></pre>
  
  <p>and I get the exact same thing. I know the PDF is being created in the correct location, as I can manually browse to it and open it fine.</p>
  
  <p>Does anyone have any ideas as to why this isn't working?  Or possibly why I don't seem to have the Reader control as an option? At this point, either solution would be fine, they just neither one seem to be working!</p>
  
  <p>Thanks!</p>