日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無(wú)先后,達(dá)者為師

網(wǎng)站首頁(yè) 編程語(yǔ)言 正文

Winform窗體中打開(kāi)PDF文件的三種方式_C#教程

作者:springsnow ? 更新時(shí)間: 2022-08-05 編程語(yǔ)言

1、使用Adobe PDF Reader控件。

從COM組件庫(kù)中找到Adobe PDF Reader控件,添加到工具箱中。

從工具箱中拖入PDF Reader控件。

可以看到VS自動(dòng)添加了AxInterop.AcroPDFLib.dll跟Interop.AcroPDFLib.dll這兩個(gè)組件。

使用代碼加載PDF文件:

//axAcroPDF1.src="D:\\aa.pdf";
 axAcroPDF1.LoadFile("D:\\aa.pdf");

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

https://docs.devexpress.com/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://www.e-iceblue.com/Introduce/free-pdf-viewer-net.html

免費(fèi)版本:在查看和打印PDF文件時(shí)限于10頁(yè)P(yáng)DF。

從nuget下載Spire.PdfVie控件。

從工具箱拖入PdfViewer控件

自動(dòng)引用了下面三個(gè)文件:

代碼加載PDF文件

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

原文鏈接:https://www.cnblogs.com/springsnow/p/13305294.html

欄目分類
最近更新