好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Winform窗体中打开PDF文件的三种方式

1、使用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");

2、使用DevExpress控件中的pdfViewer控件

https://docs.devexpress测试数据/WindowsForms/9832/controls-and-libraries/pdf-viewer/examples/file-operations/how-to-load-a-pdf-document-from-a-file

this.pdfViewer1.LoadDocument(@"Report.pdf");

3、使用Spire.PdfViewer控件

https://HdhCmsTeste-iceblue测试数据/Introduce/free-pdf-viewer-net.html

免费版本:在查看和打印PDF文件时限于10页PDF。

从nuget下载Spire.PdfVie控件。

从工具箱拖入PdfViewer控件

自动引用了下面三个文件:

代码加载PDF文件

pdfViewer1.LoadFromFile("D:\\aa.pdf");

到此这篇关于Winform打开PDF文件的文章就介绍到这了。希望对大家的学习有所帮助,也希望大家多多支持。

查看更多关于Winform窗体中打开PDF文件的三种方式的详细内容...

  阅读:77次