当前位置:网站首页>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);
}
边栏推荐
- SVN版本控制器的安装及使用方法
- Rockermq message sending and consumption mode
- 视频文件太大?使用FFmpeg来无损压缩它
- Rman-08137 main library failed to delete archive file
- i=i++;
- Installation and use of SVN version controller
- How do I get the STW (pause) time of a GC (garbage collector)?
- ucore lab3
- TDengine 邀请函:做用技术改变世界的超级英雄,成为 TD Hero
- JS 文件上传下载
猜你喜欢

Enumeration? Constructor? Interview demo

手把手带你玩摄像头模组

有關二叉樹的一些練習題

如何获取GC(垃圾回收器)的STW(暂停)时间?

C # solve the relative path problem using SQLite

Reading and writing Apache poi

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

Semi-supervised Learning入门学习——Π-Model、Temporal Ensembling、Mean Teacher简介

Es update values based on Index Names and index fields

Markem Imaje Marken IMAS printer maintenance 9450e printer maintenance
随机推荐
Object contains copy method?
std::memory_ order_ seq_ CST memory order
i=i++;
Tips for using Jupiter notebook
Object含有Copy方法?
Semi-supervised Learning入门学习——Π-Model、Temporal Ensembling、Mean Teacher简介
MySQL proficient-01 addition, deletion and modification
Video file too large? Use ffmpeg to compress it losslessly
运维一线工作常用shell脚本再整理
Digital ic-1.9 understands the coding routine of state machine in communication protocol
提高效率 Or 增加成本,开发人员应如何理解结对编程?
有关二叉树的一些练习题
JS 客户端存储
Installation and usage of source insight tool
如何获取GC(垃圾回收器)的STW(暂停)时间?
Take you to play with the camera module
基于STM32设计的蓝牙健康管理设备
最全H桥电机驱动模块L298N原理及应用
更改pip镜像源
Some considerations on operation / method overloading for thread to release lock resources