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

淺唱寂寞╮ 提交于 2019-11-27 17:17:12

问题


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



来源:https://stackoverflow.com/questions/6742720/how-to-open-or-launch-pdf-files-in-c-net

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!