当前位置:主页 > 软件编程 > .NET代码 >

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

时间:2021-03-27 09:31:27 | 栏目:.NET代码 | 点击:

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

您可能感兴趣的文章:

相关文章