I Have a test.pdf and I want to display it inside in my form.
My code is very simple:
public Form1()
{
InitializeComponent();
this.wbPdf.Navigate(@"file:///<fullpath>\test.pdf#toolbar=0");
}
and it's not working. It's showing me a white page with an "X".
But if I do instead this:
this.wbPdf.Navigate(@"file:///<fullpath>\test.pdf#toolbar=0", true);
the IE opened and it showed my pdf. Of course, I tried to use false
in the second parameter and it's not working.
Also, if I tried to do something like
this.wbPdf.Navigate(@"http://www.google.com");
it showed me google, so I think there isn't any problem of configuration of Web Browser Control
Any ideas? I'm not will be able to have Acrobat Reader installed, so using ActiveX components is not an option (also, this project is in x64
and I've read that this component is not working very well in x64
).
I want to display the pdf only for viewing inside the form, not in another window.