xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thierry Kormann" <tkorm...@ilog.fr>
Subject RE: LinearGradient not handled correctly by batik?
Date Thu, 17 Oct 2002 13:44:37 GMT

> I have an SVG document that displays correctly when using Adobe
> SVG viewer.
> However when I try to convert it to a PNG using batik-rasterizer
> it does not
> come out correctly. Here is the code
>
> <defs>
>  <linearGradient id="two_hues" x1="0%" y1="0%" x2="0%" y2="100%">
>     <stop offset="0%" style="stop-color: black;"/>
>     <stop offset="100%" style="stop-color: white;"/>
>  </linearGradient>
> </defs>
>
> <path d="M 150 94 V 356 H 600 V 94 Z" style="fill: url(#two_hues);"/>
>
> <path d="M 0 94 V 456 H 150 V 94 Z" style="fill: url(#two_hues);"/>
>
> However only the first element referencing the linearGradient has a
> gradient, the other is always a solid colour. It doesn't matter what the
> order of the path elements, always the first encountered gets the gradient
> and subsequent references to "two_hues" does not work
>
> Is this a batik problem or is there something wrong with my SVG code?

I don't know which version of batik you are using but it works in
Batik1.5b4.

Here is the svg document I have tried.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">

<svg xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink"
     width="450" height="500" viewBox="0 0 450 500">

<defs>
 <linearGradient id="two_hues" x1="0%" y1="0%" x2="0%" y2="100%">
    <stop offset="0%" style="stop-color: black;"/>
    <stop offset="100%" style="stop-color: white;"/>
 </linearGradient>
</defs>

<path d="M 150 94 V 356 H 600 V 94 Z" style="stroke:red;fill:
url(#two_hues);"/>

<path d="M 0 94 V 456 H 150 V 94 Z" style="stroke:red;fill:
url(#two_hues);"/>


</svg>



Thierry.



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


Mime
View raw message