pdf生成图片报错:Cannot read JBIG2 image: jbig2-imageio is not installed

一、问题说明

报错信息:org.apache.pdfbox.contentstream.PDFStreamEngine.operatorException(PDFStreamEngine.java:917) - Cannot read JBIG2 image: jbig2-imageio is not installed

相关环境信息:

在调用PDFRenderer的renderImageWithDPI(int pageIndex, float dpi)方法时报错

PDFRenderer用的是pdfbox,pom坐标为:

<dependency>
	<groupId>org.apache.pdfbox</groupId>
	<artifactId>pdfbox</artifactId>
	<version>2.0.19</version>
</dependency>

二、解决方案

添加以下pom依赖即可

<dependency>
	<groupId>org.apache.pdfbox</groupId>
	<artifactId>jbig2-imageio</artifactId>
	<version>3.0.2</version>
</dependency>

 

参考链接:

https://blog.csdn.net/chengzuo875963/article/details/100913781(这个链接参考过,试了发现没效果,最后通过google找到下面这个链接的方案)

https://github.com/levigo/jbig2-imageio/issues/54

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值