How to open or launch PDF Files in C#.Net? [closed

2019-01-23 23:57发布

问题:

How do I launch a PDF Programmatically from a C# application in it's own process?

Originally: I want to open PDF file when i click button in C#.Net?

回答1:

I assume you just want to open the file. Try the following

System.Diagnostics.Process.Start(@"c:\file.pdf");


回答2:

What do you mean for "open PDF file"? If you need to read all byties more simple method is:

byte[] byteArray = System.IO.File.ReadAllBytes(@"c:\file.pdf");

If you want display its on WinForm - look that



回答3:

to give the third possible answer to your question:

if you want to edit the PDF-file you can use a library like iTextSharp or PDFSharp