package com.aspose.pdf.examples;
import com.aspose.slides.*;
import com.aspose.slides.License;
import com.aspose.slides.SaveFormat;
import java.io.File;
import java.io.InputStream;
/**
* Created by LDB on 15-9-29.
*/
public class PPT2Pdf {
/**
* 获取License
*
* @return
*/
public static boolean getLicense() {
boolean result = false;
try {
License aposeLic = new License();
InputStream is = PPT2Pdf.class.getResourceAsStream("/slides.license.xml");
aposeLic.setLicense(is);
is.close();
//InputStream is = GetLicense.class.getClassLoader().getResourceAsStream("D:\\software\\word2pdf\\Aspose.Total.lic");
//License aposeLic = new License();
//aposeLic.setLicense(is);
result = true;
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
public static void main(String[] args) throws Exception {
if(!getLicense()){
System.out.println("没有license");
return;
}
// The path to the documents directory.
File dir = new File("c:/tmp/powerpoint");
File[] files = dir.listFiles();
for (File file : files) {
if (file.isFile()) {
String pdfFile = file.getAbsolutePath().replace("powerpoint", "pdf").replace(".pptx", ".pdf").replace(".ppt", ".pdf");
long time1 = System.currentTimeMillis();
try {
System.out.println("开始转换 " + file.getName() + " to " + pdfFile);
Presentation doc = new Presentation (file.getAbsolutePath());
doc.save(pdfFile, SaveFormat.Pdf);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
}
long time2 = System.currentTimeMillis();
System.out.println("转换完成 " + file.getName() + " to " + pdfFile + "; (" + (time2 - time1) + " ms)");
//return;
}
}
System.out.println("doc to PDF example completed");
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
昕光冲天仅仅只是提供了words/excel等文档的破解。没有Aspose slides,花了一点时间把Aspose Slides for java最新版本也破解了一下。 本来也要分数的,奈何我的分数实在太低,所以只能求点分了. 仅研究参考,若有版权纠纷本人概不负责
资源推荐
资源详情
资源评论
收起资源包目录
SlidesCrack.zip (5个子文件)
.project 387B
src
slides.license.xml 585B
com
aspose
pdf
examples
PPT2Pdf.java 2KB
lib
aspose-slides-15.7.0-edu.jar 30.38MB
.classpath 370B
共 5 条
- 1
tinyspace
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页