public static Document createSvgDocument(int width,int height){
  Document document=createDocument();
  Element root=document.createElement("svg");
  String w=String.valueOf(width);
  String h=String.valueOf(height);
  root.setAttribute("width",w);
  root.setAttribute("height",h);
  root.setAttribute("viewBox","0 0 " + w + " "+ h);
  root.setAttribute("version","1.1");
  root.setAttribute("xmlns",mxConstants.NS_SVG);
  document.appendChild(root);
  return document;
}

public static Document createSvgDocument ( int width , int height ) { Document document = createDocument ( ) ; Element root = document . createElement ( "svg" ) ; String w = String . valueOf ( width ) ; String h = String . valueOf ( height ) ; root . setAttribute ( "width" , w ) ; root . setAttribute ( "height" , h ) ; root . setAttribute ( "viewBox" , "0 0 " + w + " " + h ) ; root . setAttribute ( "version" , "1.1" ) ; root . setAttribute ( "xmlns" , mxConstants . NS_SVG ) ; document . appendChild ( root ) ; return document ; }
creates a new svg document for the given width and height .
