You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jay Chiu <ja...@ureach.com> on 2004/02/05 05:53:09 UTC

Problem with scaling png image file in svg section

I generate fo file with svg section to hold absolute positioned
text and images. If the image size matches the width and height
attributes of the svg:image element, the image in final
generated pdf looks fine. But if the image size is bigger than
the width/height attributes of the svg:image element, then the
quality of the image in the final pdf is very bad. 
I include the png file in svg section of .fo file through
<svg:image width="350" height="280" x="1mm" y="80"
xlink:href="p2.png"/>

But the png file directly included in .fo scales fine.
<fo:external-graphic src="url('p1.png')" width="120px"
height="100px"/>

I use jfreechart to generate the chart image. Because of
jfreechart's implementation,  I have to generate a big chart
image and put it into a smaller space to have high resolution. 

Attached please find a fo file and the generated pdf file.

Can someone please tell me how to solve this problem?

Thank you very much.

Jay

________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

Re: Problem with scaling png image file in svg section

Posted by Chris Bowditch <bo...@hotmail.com>.
Jay Chiu wrote:

> I generate fo file with svg section to hold absolute positioned
> text and images. If the image size matches the width and height
> attributes of the svg:image element, the image in final
> generated pdf looks fine. But if the image size is bigger than
> the width/height attributes of the svg:image element, then the
> quality of the image in the final pdf is very bad. 
> I include the png file in svg section of .fo file through
> <svg:image width="350" height="280" x="1mm" y="80"
> xlink:href="p2.png"/>

Have you tried running your SVG using Batik's squiggle? Does it look 
okay there. If not, then this question should really be directed at the 
Batik guys, because FOP uses Batik to handle its SVG. If it does look 
okay in squiggle, then there could be an issue in FOP's SVG-PDF Transcoder.

One other question: Does the image inside the SVG look okay if you dont 
specify width and height attributes on svg:image?

> But the png file directly included in .fo scales fine.
> <fo:external-graphic src="url('p1.png')" width="120px"
> height="100px"/>

fo:external-graphics are handled entirely within FOP.

<snip/>

Chris



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org