You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Nicholas Hemley <Ni...@lhb.scot.nhs.uk> on 2002/09/17 15:52:57 UTC

SVG->JPEG Transcoder funny business

Hello

I have a servlet that performs an XSL transformation on an SVG template in order to draw dynamic graphs.

My problem is this: When I output an SVG textfile from the servlet and load this using Internet Explorer+SVGViewer3.0  the picture is fine. But when I use Batik to generate a JPEG from the SVG, it creates a mess. Am I doing something wrong? Am I using unsupported features? I enclose the SVG and generated JPEG so you can see exactly what is happening...any help would be appreciated.

Regards,
Nic Hemley



**********************************************************************
The information contained in this message may be confidential or legally privileged and is intended for the addressee only,

If you have received this message in error or there are any problems please notify the originator immediately.

The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden.
**********************************************************************


RE: SVG->JPEG Transcoder funny business

Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "NH" == Nicholas Hemley <Ni...@lhb.scot.nhs.uk> writes:

NH> Hello I have a servlet that performs an XSL transformation on an
NH> SVG template in order to draw dynamic graphs.

NH> My problem is this: When I output an SVG textfile from the servlet
NH> and load this using Internet Explorer+SVGViewer3.0 the picture is
NH> fine. But when I use Batik to generate a JPEG from the SVG, it
NH> creates a mess. Am I doing something wrong? Am I using unsupported
NH> features? I enclose the SVG and generated JPEG so you can see
NH> exactly what is happening...any help would be appreciated.

    Well the SVG is really nasy, it has lots of Adobe specific
nonsense in it.  However the problem is that Batik is ignoring the
'transform' attribute on the switch element.  In this case it's really
simple to get rid of since it's only used in two places.

    One seems to place the image (NHS Lothian) 'off canvas' (outside
the viewbox).  So the whole switch can simply be deleted (near the top
of the file)

    The other has a transform and it's child is a g with the inverse
transform so both the transforms can go (this is why the graph doesn't
show up).

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


Re: SVG->JPEG Transcoder funny business

Posted by "Charles H. Woloszynski" <ch...@clearmetrix.com>.
Nicholas:

The JPEG translator, when I used it was fussier about your SVG than the 
Adobe plugin.  I think, for example, that it did not like/support a 
viewBox in the <svg> tag.  

To make 'portable' SVG that can be transcoded into JPEG, we had to work 
on our templates by hand until we had a set that were transcoder-friendly.

What XSL transformation engine are you using?    We used JSPs and hand 
generated the SVG, but I like the idea of using XSL in a servlet to 
address this need.

Charlie



Nicholas Hemley wrote:

>Hello
>
>I have a servlet that performs an XSL transformation on an SVG template in order to draw dynamic graphs.
>
>My problem is this: When I output an SVG textfile from the servlet and load this using Internet Explorer+SVGViewer3.0  the picture is fine. But when I use Batik to generate a JPEG from the SVG, it creates a mess. Am I doing something wrong? Am I using unsupported features? I enclose the SVG and generated JPEG so you can see exactly what is happening...any help would be appreciated.
>
>Regards,
>Nic Hemley
>
>
>
>**********************************************************************
>The information contained in this message may be confidential or legally privileged and is intended for the addressee only,
>
>If you have received this message in error or there are any problems please notify the originator immediately.
>
>The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden.
>**********************************************************************
>
>
> ------------------------------------------------------------------------
>
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: batik-users-help@xml.apache.org
>

-- 


Charles H. Woloszynski

ClearMetrix, Inc.
115 Research Drive
Bethlehem, PA 18015

tel: 610-419-2210 x400
fax: 240-371-3256
web: www.clearmetrix.com