当前位置:网站首页>Use aspese slides to convert PPT to PDF
Use aspese slides to convert PPT to PDF
2022-06-27 09:34:00 【Sparkle_ wsl】
PPT turn PDF
download jar package
link :https://pan.baidu.com/s/1a-9zm9aaiEcemXD5jaLXRw
Extraction code :cu57
Add to MVN Warehouse
mvn install:install-file -Dfile="jar Bag location " -DgroupId="groupId" -DartifactId="artifactId" -Dversion=" edition " -Dpackaging=jar -DgeneratePom=true -DcreateChecksum=true
Import dependence
<!-- take ppt turn pdf This is my own packaging -->
<dependency>
<groupId>aspose</groupId>
<artifactId>aspose-slides</artifactId>
<version>19.3</version>
</dependency>
Code
/** * ppt Turn into pdf * @param sourcePath ppt File path * @param savePath pdf Saved path */
public static void pptToPdf(String sourcePath,String savePath){
FileOutputStream outputStream = null;
// Watermark processing
final String license ="<License>\n" +
" <Data>\n" +
" <Products>\n" +
" <Product>Aspose.Total for Java</Product> \n" +
" </Products>\n" +
" <EditionType>Enterprise</EditionType>\n" +
" <SubscriptionExpiry>20991231</SubscriptionExpiry>\n" +
" <LicenseExpiry>20991231</LicenseExpiry>\n" +
" <SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>\n" +
" </Data>\n" +
" <Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature>\n" +
"</License>";
try {
// Get watermark
InputStream is = new ByteArrayInputStream(license.getBytes());
com.aspose.slides.License aposeLic = new com.aspose.slides.License();
aposeLic.setLicense(is);
// Read ppt file
FileInputStream fileInput = new FileInputStream(sourcePath);
Presentation pres = new Presentation(fileInput);
// Specify the output path
outputStream = new FileOutputStream(new File(savePath));
// Output
pres.save(outputStream, SaveFormat.Pdf);
outputStream.close();
}catch (Exception e){
e.printStackTrace();
}
}
effect

Only learn to use , Non commercial use
边栏推荐
- Five page Jump methods for wechat applet learning
- 反编译jar包,修改后重新编译为jar包
- SVN版本控制器的安装及使用方法
- The markdown plug-in of the browser cannot display the picture
- 借助原子变量,使用CAS完成并发操作
- Rockermq message sending mode
- main()的参数argc与argv
- Understand neural network structure and optimization methods
- 看看volatile你深知多少
- 一次线上移动端报表网络连接失败问题定位与解决
猜你喜欢
随机推荐
Rman-08137 main library failed to delete archive file
Take you to play with the camera module
Quartz(定时器)
js中的数组对象
Some exercises about binary tree
ucore lab3
Prometheus alarm process and related time parameter description
小白也能看懂的网络基础 03 | OSI 模型是如何工作的(经典强推)
文件名设置导致writelines写入报错:OSError: [Errno 22] Invalid argument
Understand neural network structure and optimization methods
Google browser chropath plug-in
Es update values based on Index Names and index fields
I'm almost addicted to it. I can't sleep! Let a bug fuck me twice!
prometheus告警流程及相关时间参数说明
Markem Imaje Marken IMAS printer maintenance 9450e printer maintenance
基于STM32设计的蓝牙健康管理设备
今日3大面试Demo[Integer ASCII 类关系]
借助原子变量,使用CAS完成并发操作
Several cases that do not initialize classes
Process 0, process 1, process 2








