ArrayIndexOutOfBoundsException when placing an image on report with https url and exporting to a PDF

We are trying to put an image on a report, and export to a pdf.

The image starts with https://

We see the image in Design

We see the image in Preview

When we go to export the pdf from Preview, we get an error:

net.sf.jasperreports.engine.JRException: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 1
    at net.sf.jasperreports.engine.export.JRPdfExporter$InternalImageProcessor.processImageRetainShape(
    at net.sf.jasperreports.engine.export.JRPdfExporter$InternalImageProcessor.process(
    at net.sf.jasperreports.engine.export.JRPdfExporter$InternalImageProcessor.access$300(
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportImage(
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(
    at net.sf.jasperreports.engine.JasperExportManager.exportToPdf(
    at net.sf.jasperreports.engine.JasperRunManager.runToPdf(
    at net.sf.jasperreports.engine.JasperRunManager.runReportToPdf(


When we use an image url that is just http:// we do not get this error.

How do include an image with an https:// url in our pdf?

Sample report is attached.

Attachments:'s picture
Joined: Jan 27 2021 - 6:37am
Last seen: 1 week 1 day ago

0 Answers:

No answers yet