package testpackage;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.OutputStream;
import com.aspose.words.Document;
import com.aspose.words.License;
public class Test {
/**
* 获取license
*
* @return
*/
public static boolean getLicense() {
boolean result = false;
try {
//InputStream is = Test.class.getClassLoader().getResourceAsStream("\\license.xml");
InputStream is = Test.class.getClassLoader().getResourceAsStream("testpackage/license2.xml");
// InputStream is =
// Test.class.getClassLoader().getResourceAsStream("subpackage/license3.xml");
License aposeLic = new License();
aposeLic.setLicense(is);
result = true;
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
public static void main(String[] args) {
Test t = new Test();
System.out.println(t.getClass().getClassLoader()
.getResource("license.xml"));
System.out.println(t.getClass().getClassLoader()
.getResource("testpackage/license2.xml"));
System.out.println(t.getClass().getClassLoader()
.getResource("testpackage/subpackage/license3.xml"));
// 验证License
if (!getLicense()) {
return;
}
String path = "d:\\1.doc";
InputStream is = null;
try {
is = new FileInputStream(path);
Document doc = new Document(is);
doc.save("d:\\2.docx");
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
aspose.words for java解决.doc文档转为.docx问题
5星 · 超过95%的资源 需积分: 42 81 浏览量
2017-10-25
17:42:01
上传
评论 2
收藏 7.46MB RAR 举报
赤子之心_time
- 粉丝: 0
- 资源: 2
最新资源
- Fortran语言语法快速入门.pdf
- 明日方舟 年 鼠标指针.rar
- 全国银行经济监管可视化系统
- e商小二-供应链管理物流交仓创业商业计划书.rar
- Edge浏览器下载文件提示 “无法安全下载” 的解决方法
- 基于springboot+layui的医院日常耗材管理系统.zip
- Emkex亿迈克思新型互联网磁材供应链商业计划书.rar
- 计算机毕业设计-ASP.NET某店POS积分管理系统-销售情况,会员卡再发行数据生成(源代码+)-毕设源码实例.zip
- 计算机毕业设计-asp.net某店POS积分管理系统-清除履历表、日志表、月购买额(源代码+)-毕设源码实例.zip
- 计算机毕业设计-ASP.NET某店POS积分管理系统-积分实绩更新及销售状况统计(源代码+)-毕设源码实例.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈