excel生成PDF文件

本文详细介绍了如何将Excel工作簿转换为高质量的PDF文件,包括使用Microsoft Excel内置功能、第三方软件以及在线转换工具的步骤,确保数据在转换过程中保持原始格式和布局。
摘要由CSDN通过智能技术生成
@Value(value="${bill.path}")
String billPath
@Value(value="${bill.path.file}")
String billPathFile

//定义xlsx文件模板位置
String templateFile=billPath.concat(工具类.常量)
(工具类 public static String file=''template.xlsx")
//定义文件名
String fileName=name
//定义目标文件夹
String billFileofPath=billPath.concat(当前月份).concat(billPathFile)
//定义目标文件名
String fillpath=billFileofPath.concat(fileName.concat(".xlsx"));
//生成文件夹
File request =new File(billFileofPath);
if(!request .exists()){
	request .mkdirs();
}
//写入模板数据
ExcelWriter excelWriter=EasyExcel.write(fillpath).withTemplate(new() File(templateFile)).build();
//生成工作表对象
WirteSheet writeSheet=EasyExcel.writeSheet.build();
//样式
FileConfig fileConfig=FileConfig.builder().forceNewRow(Boolean.FALSE).build();
//插入列表数据
excelWrite.fill(new FillWrapper("", list数据), fillConfig, writeSheet);
//对象中的数据
 excelWriter.fill(实体类数据, writeSheet);
 excelWriter
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值