I tried it with the rasterizer and it seemed to work:
=== me.svg ===
<?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" width="4cm" height="3cm"
viewBox="0 0 400 300">
<text id="sample" x="0" y="150">Hello, World</text>
</svg>
=== me.css ===
#sample {font-size: 48px; fill: red}
and the command:
java -jar batik-rasterizer.jar -cssUser me.css me.svg
gave me large red text as expected. This is batik-1.7 on Windows/Java 1.6
Pete
On Fri, Jul 16, 2010 at 11:37 AM, Christian Bockermann
<[email protected]> wrote:
> Hi list,
>
> I am trying to convert a single SVG file into a PNG with a user-based CSS.
>
> Without the user-based CSS everything works fine - using batik-rasterizer as
> well as embedding the Transcoder into my Java code.
>
> Then I added:
>
> log.info( "cssURL: {}", cssURL );
> t.addTranscodingHint( ImageTranscoder.KEY_USER_STYLESHEET_URI, cssURL
> );
>
> where "t" is the PNGTranscoder and "cssURL" is:
>
> file:///Users/chris/sample.css
>
> Unfortunately, I don't see any effects of the sample.css in the resulting PNG.
> If I copy&paste the contents of the sample.css into a <style>...</style>
> section
> of the SVG file, the styles are correctly applied.
>
> I get the same behaviour, when using the batik-rasterizer:
>
> java -jar batik-rasterizer.jar -cssUser /Users/chris/sample.css
> sample.svg
>
> I tried to use "-cssUser file:///Users/chris/sample.css" or the like. Nothing
> worked.
>
> Any ideas?
>
> Best regards,
>
> Chris
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]