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);
Offic转换pdf 之asposeDLL插件的更多相关文章
- OpenOfice将offic转为pdf并且在web显示
1.将office首先要安装OpenOfice,傻瓜式安装就好了,之后可以使用下列代码将word转为pdf.这个需要导入jodconverter-2.2.2里的 ja r包 import java.i ...
- 【docx4j】docx4j操作docx,实现替换内容、转换pdf、html等操作
主要是想要用此功插件操作docx,主要的操作就是操作段落等信息,另外,也想实现替换docx的内容,实现根据模板动态生成内容的效果,也想用此插件实现docx转换pdf. word的格式其实可以用xml来 ...
- atom markdown转换PDF 解决AssertionError: html-pdf: Failed to load PhantomJS module
atom编辑器markdown转换PDF 解决AssertionError: html-pdf: Failed to load PhantomJS module. You have to set th ...
- Word:转换PDF
本文适用于Word 2007 + Windows 7,造冰箱的大熊猫@cnblogs 2018/8/3 一.Word文档转PDF文档 把Word文档转换为PDF,有两个免费解决方案 1.Microso ...
- tp5 使用phpword 替换word模板并利用com组件转换pdf
tp5 使用phpword 替换word模板并利用com组件转换pdf 一.首先composer安装PHPword,就不多说了 二.然后是把模板中要替换的部分用变量代替 三.把原始的模板文件放入项 ...
- SharePoint 2013 Word 转换PDF服务介绍及示例
前言:在SharePoint使用过程中,经常会发现将文档进行格式转换的需求,之前,看到SharePoint 2013有将PPT转换PDF文档的服务,后来,才发现SharePoint 2010开始,就有 ...
- SharePoint Word 转换PDF服务介绍及示例
前言:在SharePoint使用过程中,经常会发现将文档进行格式转换的需求,之前,看到SharePoint 2013有将PPT转换PDF文档的服务,后来,才发现SharePoint 2010开始,就有 ...
- python3图片裁剪+转换pdf+压缩
本地大量长图,要发送给别人,所以要对图片进行裁剪+转换pdf+压缩 import zipfile import os from concurrent.futures import ThreadPool ...
- 将页面内容转换Pdf\Word\Excel格式
项目中用到了将邮件内容转换为Pdf.Word.Excel格式,做为邮件附件发送. 查了一些解决方案,走了一些弯路.以此代码记录下. 转换PDF需要下载NReco.PdfGenerator.dll 以下 ...
随机推荐
- java泛型与object的比较
在Java SE 1.5之前,没有泛型的情况的下,通过对类型Object的引用来实现参数的“任意化”,“任意化”带来的缺点是要做显式的强制类型转换,而这种转换是要求开发者对实际参数类型可以预知的情况下 ...
- ACM 离散化处理
使用STL算法离散化: 思路:先排序,再删除重复元素,然后就是索引元素离散化后对应的值. 1. unique(): 头文件为algorithm unique的作用是“去掉”容器中相邻元素的重复元 ...
- 《OD面试》之多线程高并发
参考: 聊聊并发(三)——JAVA线程池的分析和使用 Java Executor并发框架(三)ThreadPoolExecutor 队列缓存策略 控制并发线程数的Semaphore.Scheduled ...
- shell脚本编程的10个最佳实践
摘要:每一个在UNIX/Linux上工作的程序员可能都擅长shell脚本编程.对于那些处在shell脚本编程初级阶段的程序员来说,遵循一些恰当的做法可以帮助你更快.更好的学习这些编程技巧. 每一个在U ...
- thinkphp 连接数据库 & 实例化模型操作 (下接thinkphp CURD 操作)/慕课
7.1 连接数据库 (06:15) 1 7.2实例化模型 1 1.实例化基础模型 2 2. 实例化用户自定义模型 2 问题 2 3. 实例化公共模型 4 4. 实例化空模型 7 7.1 连接数据 ...
- ADX3000的组网配置
路由规划: 1 组网配置 2 接口信任域设置 3 静态路由设置 4 包过滤策略
- (16)break和continue
#(1)这里顺带说下pass # pass 过 的意思,防止代码报错,就是个占位的, if True: # 不允许代码块里面的内容为空,用pass占位 pass #(2)break (只能用在循环当中 ...
- 我的web安全工程师学习之路——规划篇
据网上收集的web安全工程师需要掌握哪些技能,职位要求以及如何入门,加上学习网易推出的web安全工程师微专业课程,为了进一步学习,所以给自己做了一些小小规划,也希望给同样想成为web安全工程师的同仁们 ...
- COM编程快速入门
COM编程快速入门 COM编程快速入门 http://www.vckbase.com/index.php/wv/1642 COM是一种跨应用和语言共享二进制代码的方法.与C++不同,它提倡源代码重 ...
- light oj 1047 - Neighbor House(贪心)
The people of Mohammadpur have decided to paint each of their houses red, green, or blue. They've al ...