没有什么养分,就是调用一下这个组件。其实一开始用的是Microsoft.Office.Interop.Excel;Microsoft.Office.Interop.Word服务器
可是在服务器要注意,服务器要安装Office的指定版本,具体是哪一个版本要看你引用的版本。ide
并且在服务器调用+com组件,对权限有不少要求。网上有不少答案了,这里主要说asposeexcel
using Aspose.Cells;//Excel
using Aspose.Slides;//PPTorm
public static void ppt2Pdf(string filePath,string savePath){
Presentation ppt = new Presentation(filePath);
ppt.Save(savePath, Aspose.Slides.Export.SaveFormat.Pdf);
server
}文档
public static void excel2Pdf(string filePath, string savePath)
{string
Workbook excel = new Workbook(filePath);
excel.Save(savePath, Aspose.Cells.SaveFormat.Pdf);
}io
using Aspose.Words; file
Document doc = new Document(serverPath);
doc.Save(savePath);权限
DLL的网盘:连接: http://pan.baidu.com/s/1bBeizs 密码: wfzh
本身引用转换就能够了
不过无论微软的组件仍是Aspose都有缺点。立刻给你们分享NPOI
使用 NPOI 你就能够在没有安装 Office 或者相应环境的机器上对 WORD/EXCEL 文档进行读写