Winform在窗体上打开PDF文件进行查看
时间:2020-07-15 15:57:51
收藏:0
阅读:181
窗体上显示PDF
方法一:使用Adobe PDF Reader控件。
从COM组件库中找到Adobe PDF Reader控件,添加到工具箱中。
从工具箱中拖入PDF Reader控件。
可以看到VS自动添加了AxInterop.AcroPDFLib.dll跟Interop.AcroPDFLib.dll这两个组件。
使用代码加载PDF文件:
//axAcroPDF1.src="D:\\aa.pdf"; axAcroPDF1.LoadFile("D:\\aa.pdf");
方法二:使用DevExpress控件中的pdfViewer控件
this.pdfViewer1.LoadDocument(@"Report.pdf");
方法三:使用Spire.PdfViewer控件
https://www.e-iceblue.com/Introduce/free-pdf-viewer-net.html
从nuget下载Spire.PdfVie控件。
从工具箱拖入PdfViewer控件
自动引用了下面三个文件:

代码加载PDF文件
pdfViewer1.LoadFromFile("D:\\aa.pdf");
原文:https://www.cnblogs.com/springsnow/p/13305294.html
评论(0)