当前位置:网站首页>使用Aspose.cells将Excel转成PDF
使用Aspose.cells将Excel转成PDF
2022-06-27 09:24:00 【Sparkle_wsl】
使用Aspose.cells将Excel转成PDF
源文档地址
https://blog.csdn.net/dxyzhbb/article/details/90408092
下载jar包
链接:https://pan.baidu.com/s/1QbhZ-6qmG1N-n6BoF3yZTQ
提取码:npdy
添加到自己的mvn仓库
mvn install:install-file -Dfile="jar包位置" -DgroupId="groupId" -DartifactId="artifactId" -Dversion="版本" -Dpackaging=jar -DgeneratePom=true -DcreateChecksum=true
导包
<!--将excel转成pdf(自己的打包方式)-->
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-cells</artifactId>
<version>8.5.2</version>
</dependency>
代码
@Test
public void excelToPdf() throws Exception {
//去除水印
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`在这里插入代码片`ls.License();
license.setLicense(is);
//创建Workbook对象
Workbook workbook = new Workbook("C:\\Users\\wucn\\Desktop\\work\\OA\\测试.xls");
//保存成pdf
workbook.save("C:\\Users\\wucn\\Desktop\\work\\OA\\测试.xls.pdf", com.aspose.cells.SaveFormat.PDF);
}
边栏推荐
- 冒牌构造函数???
- Obsidian 一周使用心得(配置、主题和插件)
- About the problem that the El date picker Click to clear the parameter and make it null
- Rman-08137 main library failed to delete archive file
- Oracle uses an SQL to find out which data is not in a table
- std::memory_order_seq_cst内存序
- Design of multiple classes
- There is no doubt that this is an absolutely elaborate project
- 提高效率 Or 增加成本,开发人员应如何理解结对编程?
- SVN版本控制器的安装及使用方法
猜你喜欢

提高效率 Or 增加成本,开发人员应如何理解结对编程?

【系统设计】邻近服务
![[vivid understanding] the meanings of various evaluation indicators commonly used in deep learning TP, FP, TN, FN, IOU and accuracy](/img/d6/119f32f73d25ddd97801f536d68752.png)
[vivid understanding] the meanings of various evaluation indicators commonly used in deep learning TP, FP, TN, FN, IOU and accuracy

Improving efficiency or increasing costs, how should developers understand pair programming?

Getting started with webrtc: 12 Rtendpoint and webrtcendpoint under kurento

This, constructor, static, and inter call must be understood!

【生动理解】深度学习中常用的各项评价指标含义TP、FP、TN、FN、IoU、Accuracy

Installation and use of SVN version controller

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

MATLAB小技巧(19)矩阵分析--主成分分析
随机推荐
I'm almost addicted to it. I can't sleep! Let a bug fuck me twice!
IO管脚配置和pinctrl驱动
C# 解决使用SQLite 的相对路径问题
DV scroll board width of datav rotation table component
June 26, 2022 (LC 6100 counts the number of ways to place houses)
Several cases that do not initialize classes
ThreadLocal再次挖掘它的知识点
静态代码块Vs构造代码块
JS 客户端存储
[diffusion model]
Apache POI的读写
Principle and application of the most complete H-bridge motor drive module L298N
Some exercises about binary tree
ucore lab5
Matlab tips (18) matrix analysis -- entropy weight method
There is no doubt that this is an absolutely elaborate project
Improving efficiency or increasing costs, how should developers understand pair programming?
prometheus告警流程及相关时间参数说明
【生动理解】深度学习中常用的各项评价指标含义TP、FP、TN、FN、IoU、Accuracy
Use CAS to complete concurrent operations with atomic variables