软件编程
位置:首页>> 软件编程>> C#编程>> C# WinForm打开PDF文件并在窗体中显示

C# WinForm打开PDF文件并在窗体中显示

作者:wenjunsu  发布时间:2023-11-14 10:47:49 

标签:C#,WinForm,PDF

1.添加引用

工具箱---右键---选择项--COM组件--Adobe PDF Reader

2.使用方法


OpenFileDialog openFile=new OpenFileDialog();
open..Filter = "PDF文件|*.pdf";
openFile.ShowDialog();
axAcroPDF1.src = openFile.FileName;
//axAcroPDF1.LoadFile(of.FileName);   //使用方法二

除了这种方法,网上还有一些开源的项目,可以直接打开PDF文件,大家也可以参考下

http://www.codeproject.com/KB/silverlight/BlendPDFwithSilverlight.aspx

http://www.codeproject.com/KB/applications/PDFViewerControl.aspx

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com