I have created a SVGDocument from an existing svg file and I added something to the
DOM Tree (using SVGGraphics2D),
-----
try {
String parser = XMLResourceDescriptor.getXMLParserClassName();
SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
String uri = "file:" + new File("/0_Samples/world8.svg").getAbsolutePath();
Document doc2 = f.createDocument(uri);
g = new SVGGraphics2D(doc2);
double left = 99;
double top = 222;
int width = 10;
int height = 10;
Shape circle = new Ellipse2D.Double(left,top,width,height);
g.setPaint(Color.red);
g.fill(circle);
g.translate(10,0);//distance, ancle


      // The following populates the document root with the
      // generated SVG content.
      Element root = doc2.getDocumentElement();
      g.getRoot(root);

doc = (SVGDocument)doc2;
svgCanvas.setSVGDocument(doc);// invokes the rendering
//this works splendid and is rendered just as I want it, the file plus the red dot
streamsvg(g);
}
catch (Exception ex) {}
-----
now I want to stream out the SVGDocument.


When I do so using a FileWriter, the file just contains the parts I added with the SVGGraphics2D and not the
original DOM Tree from my svg file
----
public void streamsvg(SVGGraphics2D out){
try
{
boolean useCSS = true;
Writer raus = new OutputStreamWriter(System.out, "UTF-8");
out.stream(raus, useCSS);
Writer file = new FileWriter("bert.svg");
out.stream(file, useCSS);
System.out.println("geschrieben");


      }
        catch(Exception ex){}

    }
-----

thanks a lot for any suggestions!!!!

cheers

Georg
--



Georg Apitz

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WALS Project
Executive Programmer

Max Planck Institute for Evolutionary Anthropology
Inselstrasse 22
04103 Leipzig
Germany
Phone: +49 (0) 341 99 52 - 257
Telefax: +49 (0) 341 99 52 - 119

[EMAIL PROTECTED]
www.eva.mpg.de
www.ge-org.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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



Reply via email to