Offic转换pdf 之asposeDLL插件


//
excel转换 Workbook workbook = new Workbook(HttpContext.Current.Server.MapPath(docpath + "/" + newFileName + sExtension));//找到转换文件 string newFilePath = docpath + "NewFile/"; string newuploadPath = HttpContext.Current.Server.MapPath(newFilePath);//找到转换后文件所存放的路径 string newfileName = newFileName + ".pdf"; string err = ""; if (!Directory.Exists(newuploadPath))//没有此文件夹直接创建 { Directory.CreateDirectory(newuploadPath); } workbook.Save(HttpContext.Current.Server.MapPath(newFilePath + newfileName), Aspose.Cells.SaveFormat.Pdf);//转换中 //word转换 Aspose.Words.Document doc = new Aspose.Words.Document(HttpContext.Current.Server.MapPath(docpath + "/" + newFileName + sExtension)); string newFilePath = docpath + "NewFile/"; string newuploadPath = HttpContext.Current.Server.MapPath(newFilePath); string newfileName = newFileName + ".pdf"; string err = ""; if (!Directory.Exists(newuploadPath)) { Directory.CreateDirectory(newuploadPath); } doc.Save(HttpContext.Current.Server.MapPath(newFilePath + newfileName), Aspose.Words.SaveFormat.Pdf); //ppt转换 Presentation pres = new Presentation(HttpContext.Current.Server.MapPath(docpath + "/" + newFileName + sExtension)); string newFilePath = docpath + "NewFile/"; string newuploadPath = HttpContext.Current.Server.MapPath(newFilePath); string newfileName = newFileName + ".pdf"; string err = ""; if (!Directory.Exists(newuploadPath)) { Directory.CreateDirectory(newuploadPath); } pres.Save(HttpContext.Current.Server.MapPath(newFilePath + newfileName), Aspose.Slides.Export.SaveFormat.Pdf);
posted @ 2017-02-24 18:41  llightsnow  阅读(734)  评论(0编辑  收藏  举报