开发者

OpenFileDialog to view pdf file c#

开发者_开发知识库

I just want to open a pdf file and not to use it. If the user wants to be able to print via a glider. I want to just pressing a button will open the file if Acrobat Reader to view


To open the PDF, try using the following code with the PDF's filename as the command.

string command=@"c:\Users\User\Desktop\hello.pdf";

var process = new System.Diagnostics.Process
            {
                StartInfo =
                    new System.Diagnostics.ProcessStartInfo(command)
            };

process.Start();


Visual Basic CODE:

  Dim FilePath As String = "<YourFilePath>" & "<YourFileName>" & ".pdf"
  Dim Process As System.Diagnostics.Process = New System.Diagnostics.Process
  Process.StartInfo.FileName = FilePath
  Process.Start()

Every time the relative pdf file will show on a separate window

Obviously you MUST HAVE Adobe Reader INSTALLED on the CLIENT PC

It works pefectly. Used in Visual Studio 2010.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜