Rank: Newbie Groups: Member
Joined: 2/18/2014 Posts: 3
|
I am trying to display pdf (local and from web) using WPF WebControl, but every time i see only black screen. Web browser works well when opening HTML files. I tried this using example TabbedBrowser but result was the same. I am using VS 2012.
Here is my code:
<Grid> <eo:WebControl Grid.Row="0" Visibility="Visible" Name="webBrowser" Background="Transparent" Margin="0,0,0,43"> <eo:WebControl.WebView> <eo:WebView Url="C:\test.pdf" /> </eo:WebControl.WebView> </eo:WebControl> </Grid>
When i open source i can see:
<html><body marginwidth="0" marginheight="0" style="background-color: rgb(38,38,38)"><embed width="100%" height="100%" name="plugin" src="file:///C:/test.pdf" type="application/pdf"></body></html>
I thought that background is covering file that is why i tried to change it but it has no effect. Is there way to fix it or some work around ?
Thanks !
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
Please check whether you have Adobe Reader installed on your machine. Installing Adobe Reader will install the browser plug-ins needed to render PDF file. Recently browsers such as newer version of Chrome and IE has built-in code to display PDF file and it does not need such plug-ins. However EO.WebBrowser doesn't have that part built-in yet, so it still need the standalone plug-in.
Thanks!
|
Rank: Newbie Groups: Member
Joined: 2/18/2014 Posts: 3
|
I have Adobe Reader installed, but thank to your reply i found the problem. I switched PDF plugin in Chrome to Adobe and then trying to open html from my first post I received error message that PDF plugin crashed . Following instruction from Adobe forum i managed to fix it http://forums.adobe.com/message/5629884 . Thanks !
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Ah. Thank you very much for sharing!
|