[#11126] - Transparent images in PDFs genereted by Jasper/iText are shown as red rectangle in Adobe Reader on Android

Bug report
Project: Severity:
Component: Reproducibility:
Assigned to:

We're generating PDF Reports via JasperReports Framework (Version 6.3.1 with iText 2.1.7).
Recently we faced a problem with Adobe Reader on Android tablets: instead of the embedded images a ..red rectangle will be shown!

We noticed this problem for the first time with the Abrobat Reader Version 17.5.180092, and it still exists with the current version
(The Reader 17.0.* displays the PDFs correctly)
Displaying the same PDFs in Adobe Reader on all other platforms (Windows, iOS) with newest Reader Versions and with another PDF readers works without any problems.

A deeper investigation revealed that the reason is based on a transparent image, which was added by Jasper
(GIF loaded: net\sf\jasperreports\engine\images\pixel.GIF),
presumably used to position the image with user data.

On Android, the Acrobat Reader seems to display this image on top, in red color, and it obscures the graphic behind it.
In PDF editing tools (like Acrobat Pro) this transparent image can be captured and then moved, removed or set to background.
The PDF document looks fine in Adobe Reader on Android after this modification.

Is there any way to avoid this "behavior"?
Like forcing the transparent image to be invisible?
(Upgrading to newest version of Jasper: 6.6 didn't solve this problem)

We are grateful for any help.

How we embed the graphics usually within jrxml:
<image scaleImage="RealSize">
<reportElement positionType="Float" x="0" y="27" width="609" height="50" backcolor="#FFFFFF"/>
<pen lineWidth="1.0"/>
<imageExpression class="net.sf.jasperreports.engine.JRRenderable"><![CDATA[$F{grafik}]]></imageExpression>

In Java we implemented a Renderer class as follows:
public class ReportGraphicRenderer extends AbstractRenderToImageDataRenderer {
public void render(JasperReportsContext jasperReportsContext, Graphics2D grx, Rectangle2D rectangle) {
// Do graphic operations


ckux01's picture
Joined: Aug 22 2018 - 7:53am
Last seen: 7 months 4 weeks ago

1 Comment:


Thanks to your brilliant analysis about pixel.gif I had the idea of replacing the gif with a png and that did the trick. So in my case I extended JrPDFExporter and overwrote getPxImage so that it returns a transparent PNG image.