开发者

C# : Pdf file opens in a new window .. instead of opening within the form

开发者 https://www.devze.com 2023-03-06 08:40 出处:网络
Here is the code snippet: public Documentation_File(String path, String name, Documentation_Option doc_option)

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消