Aspose系列實現docx轉PDF,PPT轉PDF,EXCEL轉PDF

沒有什麼養分,就是調用一下這個組件。其實一開始用的是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 文檔進行讀寫

相關文章
相關標籤/搜索