当前位置:网站首页>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);
}
边栏推荐
- Internal class ~ lock ~ access modifier
- ucore lab5
- Brief introduction to SSL encryption process
- Parameters argc and argv of main()
- Collection framework generic LinkedList TreeSet
- C # solve the relative path problem using SQLite
- IO pin configuration and pinctrl drive
- [original] typescript string UTF-8 encoding and decoding
- 不容置疑,这是一个绝对精心制作的项目
- I'm almost addicted to it. I can't sleep! Let a bug fuck me twice!
猜你喜欢

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

I'm almost addicted to it. I can't sleep! Let a bug fuck me twice!

视频文件太大?使用FFmpeg来无损压缩它

Apache POI的读写

基于STM32设计的蓝牙健康管理设备
![文件名设置导致writelines写入报错:OSError: [Errno 22] Invalid argument](/img/08/2d4f425e6941af35616911672b6fed.png)
文件名设置导致writelines写入报错:OSError: [Errno 22] Invalid argument

The largest rectangle in the bar graph of force buckle 84

One week's experience of using Obsidian (configuration, theme and plug-in)

Object含有Copy方法?

Markem imaje马肯依玛士喷码机维修9450E打码机维修
随机推荐
更改pip镜像源
ucore lab4
How do I get the STW (pause) time of a GC (garbage collector)?
openpyxl表格读取实例
Vector:: data() pointer usage details
快速入门CherryPy(1)
MYSQL精通-01 增删改
HiTek电源维修X光机高压发生器维修XR150-603-02
unity--newtonsoft.json解析
Reading and writing Apache poi
Win10 add right-click menu for any file
谷歌浏览器 chropath插件
数据类型占内存大小?LongVsObject
Rockermq message sending mode
[MySQL basic] general syntax 1
vector::data() 指针使用细节
Enumeration? Constructor? Interview demo
使用aspose-slides将ppt转pdf
js中的数组对象
The markdown plug-in of the browser cannot display the picture