1
votes

I'm creating piecharts using JFreeChart, use chart.createBufferedImage(width,height) and give the buffered image to IReport as an image parameter. In IReport I have an image and its image expression points to this parameter, so I can render the image. But when exported to PDF, images are covered with a black rectangle. Something about transparency or RGB, I guess.

There's a thread here about this problem and some suggested solutions, but I couldn't apply them to my problem, will you help me? Thanks.

The thread: http://www2.jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=21922&page=2#24710

1
Well, transparency or RGB are good guesses. Are the images you're trying to embed transparent? Are they RGB images? - Pekka
well, I only got createBufferedImage() method, and I can't find a way to set RGB or trasparency values from JFreeChart - Halo

1 Answers

1
votes

As suggested by @Pekka, this is likely a limitation of Transparency in PDF files.

I can't find a way to set RGB or trasparency values from JFreeChart.

The JFreeChart class includes a createBufferedImage() method that accepts an imageType, which is subsequently used to create the BufferedImage . You may have to select the optimal one empirically.