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 John Greene <jo...@rpiwireless.com> on 2003/08/10 02:47:30 UTC

Re: SVGDocument to document.svg --- HOW?---**THIS WORKS

This method will write an SVG document.

-----------------------------------

 public static void writeSVGFile(){
        SVGDocument document=Public.uIMan.getActiveViewer().getSVGDoc();
        File file=new File("c:/a2/eatme.svg");
        try{
            FileWriter writer=new FileWriter(file);
            DOMUtilities.writeDocument(document,writer);
            writer.flush();
            writer.close();   
        }catch(Exception e){System.out.println(e);}}

--------------------------------------

NOTE: Don't forget the flush and close otherwise the writer will leave 
off the end of your document (and your viewer will choke).



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