Offic转换pdf 之asposeDLL插件

2018-06-27 09:54:38来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折


//
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);

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:C#基础之运行环境

下一篇:.Net 面试题 汇总(二)