Kevin Finley wrote:

The following code prints correct-looking svg to stdout, but the resulting png
file is invalid (just a black rectangle in PaintShop Pro; Netscape says it
contains errors):

I believe that g.stream() or g.getRoot() 'clean out' the SVGGraphics2D. So only the stream to std out is correct everything else is empty. This isn't my area of expertise so it is possible I am wrong.

   I don't know why Netscape says there are errors. I view PNG's
generated by Batik all the time in Netscape/Mozilla.  Note that
these PNG files do have an alpha channel - which not all viewers
understand.

      Writer out = new OutputStreamWriter( System.out, "UTF-8" );
      g.stream( out, useCSS );
      Writer svgStringWriter = new StringWriter();
      g.stream( svgStringWriter, useCSS );
      svgString = svgStringWriter.toString();





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to