Tag Archives: PDF operation

Can read JBIG2 image: JBIG2 imageio is not installed

1、 Problem description

Error information: org.apache.pdfbox . contentstream.PDFStreamEngine.operatorException ( PDFStreamEngine.java:917 ) – Cannot read JBIG2 image: jbig2-imageio is not installed

Relevant environmental information:

An error occurred when calling the renderimagewithdpi (int PageIndex, float DPI) method of pdfrenderer

Pdfrenderer uses pdfbox, POM coordinates are:

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

2、 Solutions

Add the following POM dependencies

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

 

Reference link:

https://blog.csdn.net/chengzuo875963/article/details/100913781 (this link has been used for reference, but it didn’t work after trying. Finally, we found the scheme of the following link through Google.)

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