Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Dynamic SVG image doesn't show transparent shapes in PDF report
Dynamic SVG image doesn't show transparent shapes in PDF report [message #662750] Thu, 31 March 2011 19:05 Go to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi guys,

I have an SVG Image created using the Apache Batik framework. It's a JFreeChart panel drawn into the SVG xml file. It contains some text and shapes. And I would like to insert this image into my PDF BIRT report.

So far I have a table containing an dynamic image which is bound to a parameter of a scripted DataSet. This DataSet has an handler java class where I contribute byte array of the SVG document to the parameter. The image has also it's handler java class. In it's onPrepare() method I just set image.setMimeType("image/svg+xml").

This way the PDF report contains my SVG image. Great Surprised But, there are 2 problems Sad

  1. It absolutely ignores all shapes which have set the opacity (or alpha) value less than 1. When I try to save the SVG document to file.svg and open it in Gimp or Firefox, it looks fine. All transparent shapes are in.
  2. I would like to have this image cover all the PDF page. How can I do that? Let say the SVG image document is generated with 800 x 600 pixel size. Image item is in a table. I can set size of the image item to whatever I want, but the image is either clipped or there is empty space around it. The image doesn't respect size of the image item.

Can somebody help me please? Sorry about my English.

[Updated on: Thu, 31 March 2011 19:09]

Report message to a moderator

Re: Dynamic SVG image doesn't show transparent shapes in PDF report. [message #662756 is a reply to message #662750] Thu, 31 March 2011 19:38 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Are you generating the PDF with the API?

Jason


On 3/31/2011 3:06 PM, Behnil wrote:
> Hi guys,
>
> I have an SVG Image created using the Apache Batik framework. It's a
> JFreeChart panel drawn into the SVG xml file. It contains some text and
> shapes. And I would like to insert this image into my PDF BIRT report.
>
> So far I have a table containing an dynamic image which is bound to a
> parameter of a scripted DataSet. This DataSet has an handler java class
> where I contribute byte array of the SVG document to the parameter. The
> image has also it's handler java class. In it's onPrepare() method I
> just set image.setMimeType("image/svg+xml").
>
> This way the PDF report contains my SVG image. Great :o But, there are 2
> problems :(
> It absolutely ignores all shapes which have set the opacity (or alpha)
> value less than 1. When I try to save the SVG document to file.svg and
> open it in Gimp or Firefox, it looks fine. All transparent shapes are
> in. I would like to have this image cover all the PDF page. How can I do
> that? Let say the SVG image document is generated with 800 x 600 pixel
> size. Image item is in a table. I can set size of the image item to
> whatever I want, but the image is either clipped or there is empty space
> around it. The image doesn't respect size of the image item.
>
> Can somebody help me please? Sorry about my English.
Re: Dynamic SVG image doesn't show transparent shapes in PDF report. [message #662764 is a reply to message #662756] Thu, 31 March 2011 20:33 Go to previous messageGo to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi Jason. Yes, I am.
Re: Dynamic SVG image doesn't show transparent shapes in PDF report. [message #662810 is a reply to message #662764] Fri, 01 April 2011 03:43 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

What PDF Render Options are you using? Can send me an email with one of
the svg images? jasonweathersby at windstream dot net.

Jason

On 3/31/2011 4:33 PM, Behnil wrote:
> Hi Jason. Yes, I am.
Re: Dynamic SVG image doesn't show transparent shapes in PDF report. [message #662836 is a reply to message #662810] Fri, 01 April 2011 07:33 Go to previous messageGo to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
I use only these render options:

renderOption.setOutputFormat(RenderOption.OUTPUT_FORMAT_PDF) ;
renderOption.setOutputFileName(filePath);

where renderOption is instance of the RenderOption class and filePath is path of the PDF report file Smile

I forgot to mention that when I start generate the PDF report, it writes to the console about 20 of these messages:
Graphics2D from BufferedImage lacks BUFFERED_IMAGE hint

I can't send you the SVG file because I can't see your email address. Where can I found it?
Re: Dynamic SVG image doesn't show transparent shapes in PDF report. [message #662959 is a reply to message #662836] Fri, 01 April 2011 15:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

my email address is
jasonweathersby at windstream dot net.

Jason

On 4/1/2011 3:33 AM, Behnil wrote:
> I use only these render options:
>
> renderOption.setOutputFormat(RenderOption.OUTPUT_FORMAT_PDF) ;
> renderOption.setOutputFileName(filePath);
>
> where renderOption is instance of the RenderOption class and filePath is
> path of the PDF report file :)
>
> I forgot to mention that when I start generate the PDF report, it writes
> to the console about 20 of these messages:
> Graphics2D from BufferedImage lacks BUFFERED_IMAGE hint I can't send you
> the SVG file because I can't see your email address. Where can I found it?
Re: Dynamic SVG image doesn't show transparent shapes in PDF report. [message #663069 is a reply to message #662959] Sun, 03 April 2011 07:36 Go to previous messageGo to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Sent Razz
Re: Dynamic SVG image doesn't show transparent shapes in PDF report. [message #663279 is a reply to message #663069] Mon, 04 April 2011 13:51 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I responded to your email.

Jason

On 4/3/2011 3:36 AM, Behnil wrote:
> Sent :p
Re: Dynamic SVG image doesn't show transparent shapes in PDF report. [message #663319 is a reply to message #663279] Mon, 04 April 2011 15:14 Go to previous message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Thanks Jason. I've created bug for thr trasparency:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=341785

[Updated on: Mon, 04 April 2011 17:10]

Report message to a moderator

Previous Topic:Preview errors [SOLVED]
Next Topic:Multiple stacked columns in a bar chart
Goto Forum:
  


Current Time: Sat Apr 27 02:41:58 GMT 2024

Powered by FUDForum. Page generated in 0.03193 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top