28

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
  • do you need to open it for reading? editing? image extraction? PDFToolkit is what I normally use for all that stuff, dunno if you can use it in c# tho
    – Jason
    Jul 19, 2011 at 5:55

3 Answers 3

129

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

System.Diagnostics.Process.Start(@"c:\file.pdf");
1
  • 12
    Mark the ans right, if you get it. It helps others
    – Naruto
    Dec 10, 2012 at 6:33
3

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

0
1

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.