当前位置:网站首页>Use aspese Cells convert Excel to PDF
Use aspese Cells convert Excel to PDF
2022-06-27 09:34:00 【Sparkle_ wsl】
Use Aspose.cells take Excel Turn into PDF
Source document address
https://blog.csdn.net/dxyzhbb/article/details/90408092
download jar package
link :https://pan.baidu.com/s/1QbhZ-6qmG1N-n6BoF3yZTQ
Extraction code :npdy
Add to your own mvn Warehouse
mvn install:install-file -Dfile="jar Bag location " -DgroupId="groupId" -DartifactId="artifactId" -Dversion=" edition " -Dpackaging=jar -DgeneratePom=true -DcreateChecksum=true
Guide pack
<!-- take excel Turn into pdf( Own packaging method )-->
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-cells</artifactId>
<version>8.5.2</version>
</dependency>
Code
@Test
public void excelToPdf() throws Exception {
// Remove watermark
String licenseXml = "<License><Data><Products><Product>Aspose.Total for Java</Product><Product>Aspose.Words for Java</Product></Products><EditionType>Enterprise</EditionType><SubscriptionExpiry>20991231</SubscriptionExpiry><LicenseExpiry>20991231</LicenseExpiry><SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber></Data><Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature></License>";
ByteArrayInputStream is = new ByteArrayInputStream(licenseXml.getBytes());
com.aspose.cells.License license = new com.aspose.cel` Insert a code chip here `ls.License();
license.setLicense(is);
// establish Workbook object
Workbook workbook = new Workbook("C:\\Users\\wucn\\Desktop\\work\\OA\\ test .xls");
// Save as pdf
workbook.save("C:\\Users\\wucn\\Desktop\\work\\OA\\ test .xls.pdf", com.aspose.cells.SaveFormat.PDF);
}
边栏推荐
- 队列,双向队列,及其运用
- 提高效率 Or 增加成本,开发人员应如何理解结对编程?
- Conception de plusieurs classes
- The most direct manifestation of memory leak
- Collection framework generic LinkedList TreeSet
- unity--newtonsoft.json解析
- 1098 Insertion or Heap Sort(堆排序解释)(PAT甲级)
- 【mysql篇-基础篇】通用语法1
- One week's experience of using Obsidian (configuration, theme and plug-in)
- Nosql 数据库 -Redis 安装
猜你喜欢

When multiple network devices exist, how to configure their Internet access priority?

高等数学第七章微分方程

Apache POI的读写

ServletConfig and ServletContext

ucore lab3

【mysql篇-基础篇】通用语法1

不容置疑,这是一个绝对精心制作的项目

Process 0, process 1, process 2

【系统设计】邻近服务

This application failed to start because it could not find or load the QT platform plugin
随机推荐
分布式文件存储系统的优点和缺点
Semi-supervised Learning入门学习——Π-Model、Temporal Ensembling、Mean Teacher简介
Location and solution of network connection failure of primary online mobile terminal Report
MySQL proficient-01 addition, deletion and modification
我大抵是卷上瘾了,横竖睡不着!竟让一个Bug,搞我两次!
Apache POI的读写
When multiple network devices exist, how to configure their Internet access priority?
js中的数组对象
I'm almost addicted to it. I can't sleep! Let a bug fuck me twice!
Object contains copy method?
Flow chart of Alipay wechat payment business
Es update values based on Index Names and index fields
Imx8qxp DMA resources and usage (unfinished)
win10为任意文件添加右键菜单
Privacy computing fat offline prediction
Rman-08137 main library failed to delete archive file
如何获取GC(垃圾回收器)的STW(暂停)时间?
Several cases that do not initialize classes
静态代码块Vs构造代码块
10 常见网站安全攻击手段及防御方法