Harsha
Harsha

Reputation: 41

net.sf.jasperreports.engine.JRException: java.io.IOException: The byte array is not a recognized imageformat

net.sf.jasperreports.engine.JRException: java.io.IOException: The byte array is not a recognized imageformat.

I am getting this error when I am running the jrxml file that contain images in jasper. I have changed the version of the itext also in pom.xml file. but its still not working, Can anyone help me with this.

Upvotes: 4

Views: 5799

Answers (2)

cafedead
cafedead

Reputation: 51

In my case, I was trying to fetch the image from the classpath, and I was using the same object for creating two diff PDF by changing some values. I used FileInputStream to read the image. This error occurred because we can't reuse InputStream in Java.

Upvotes: 5

Damir Izimbergenov
Damir Izimbergenov

Reputation: 1

This can solve the problem:

<dependency>
    <groupId>org.apache.xmlgraphics</groupId>
    <artifactId>batik-all</artifactId>
    <version>1.13</version>
</dependency>

Upvotes: -3

Related Questions