当前位置:网站首页>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
边栏推荐
猜你喜欢

【系统设计】邻近服务

Semi supervised learning—— Π- Introduction to model, temporary assembling and mean teacher

Process 0, process 1, process 2

Flow chart of Alipay wechat payment business

Object contains copy method?

最全H桥电机驱动模块L298N原理及应用

Win10 add right-click menu for any file
![[system design] proximity service](/img/02/57f9ded0435a73f86dce6eb8c16382.png)
[system design] proximity service

E+h secondary meter repair pH transmitter secondary display repair cpm253-mr0005

Source insight 工具安装及使用方法
随机推荐
Semi supervised learning—— Π- Introduction to model, temporary assembling and mean teacher
MySQL proficient-01 addition, deletion and modification
了解神经网络结构和优化方法
i=i++;
Privacy computing fat offline prediction
How do I get the STW (pause) time of a GC (garbage collector)?
Decompile the jar package and recompile it into a jar package after modification
One week's experience of using Obsidian (configuration, theme and plug-in)
Prometheus alarm process and related time parameter description
Imx8qxp DMA resources and usage (unfinished)
Installation and usage of source insight tool
【mysql篇-基础篇】通用语法1
Hitek power supply maintenance X-ray machine high voltage generator maintenance xr150-603-02
std::memory_ order_ seq_ CST memory order
Improving efficiency or increasing costs, how should developers understand pair programming?
Rman-08137 main library failed to delete archive file
初步认识pytorch
std::memory_order_seq_cst内存序
Markem Imaje Marken IMAS printer maintenance 9450e printer maintenance
HiTek电源维修X光机高压发生器维修XR150-603-02