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?
in Windows, i just use this code: ShellExecute(GetDesktopWindow(), "open", "D:\\Folder\\File. pdf", NULL, NULL, SW_SHOWNORMAL);
Right-click on the PDF file and select "Open With". Select "Adobe Reader" from the list of programs.
Suppose we have a PDF file “file. pdf” in the Downloads directory. Or directly provide the file name and path to the evince command to open a PDF file from anywhere in a Linux terminal. After providing a PDF file and executing the evince command, the PDF file will open up.
I assume you just want to open the file. Try the following
System.Diagnostics.Process.Start(@"c:\file.pdf");
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With