Here is the code snippet:
public Documentation_File(String path, String name, Documentation_Option doc_option)
{
_doc_option = doc_option;
InitializeComponent();
WebBrowser web = new WebBrowser();
web.Url = new Uri(path);
}
开发者_JS百科
Note path ==> path of a certain document.
I would like the pdf file to open inside the C# form itself. Instead it opens up in a new window.
If Acrobat is installed, you could try to load their ActiveX control into your form, and bypass the WebBrowser.
There are toolkits that can be used to show a PDF in a form:
Disclaimer: I work at Atalasoft: DotImage Photo is free and will give you a viewer component, and you can add on the PDF Reader for it to view PDF.
精彩评论