利用aspose-cells解决 excel预览的折叠问题

1、jar包

<dependency>
			<groupId>com.aspose.cells</groupId>
			<artifactId>aspose-cells</artifactId>
			<version>8.5.2</version>
		</dependency>

2、在根目录放:license.xml 

具体资源请下载:

https://download.csdn.net/download/gzc_870301/12403483

/**
 *@description excel转pdf  解决折叠问题(列太多)
 * @author gezc30201
 * @date 2020/5/9
 */
@Slf4j
public class ExcelToPdfUtil {

    /**
     *@description 获取license 去除水印
     * @return
     * @author gezc30201
     * @date 2020/5/9
     */
    public static boolean getLicense() {
        boolean result = false;
        try {
            InputStream is = ExcelToPdfUtil.class.getClassLoader().getResourceAsStream("\\license.xml");
            License aposeLic = new License();
            aposeLic.setLicense(is);
            result = true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }

    /**
     *@description excel 转为pdf 输出。
     * @param sourceFilePath   excel文件
     * @param desFilePathd   pad 输出文件目录
     * @return void
     * @author gezc30201
     * @date 2020/5/9
     */
    public static void excel2pdf(String sourceFilePath, String desFilePathd ){
        if (!getLicense()) { // 验证License 若不验证则转化出的pdf文档会有水印产生
            return;
        }
        try {
            Workbook wb = n
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值