import java.awt.Rectangle;
import java.awt.Graphics2D;
import java.io.Writer;
import java.io.FileWriter;
import java.io.IOException;
import org.apache.batik.svggen.SVGGraphics2D;
import org.apache.batik.dom.GenericDOMImplementation;
import org.w3c.dom.Document;
import org.w3c.dom.DOMImplementation;
public class SVGGraphics2DDemo {
public void paint(Graphics2D g){
g.drawString("Java,XML and Web Services Bible",12,12);
}
public static void main(String args[]) throws IOException{
SVGGraphics2DDemo sv2Demo = new SVGGraphics2DDemo();
DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
Document doc = domImpl.createDocument(null, "svg", null);
SVGGraphics2D svg = new SVGGraphics2D(doc);
sv2Demo.paint(svg);
svg.stream(new FileWriter("booktitle.svg"),false);
}
}
//booktitle.svg
/*
*/