public Picture renderToPicture(){
  Length width=rootElement.width;
  if (width != null) {
    float w=width.floatValue(this.renderDPI);
    float h;
    Box rootViewBox=rootElement.viewBox;
    if (rootViewBox != null) {
      h=w * rootViewBox.height / rootViewBox.width;
    }
 else {
      Length height=rootElement.height;
      if (height != null) {
        h=height.floatValue(this.renderDPI);
      }
 else {
        h=w;
      }
    }
    return renderToPicture((int)Math.ceil(w),(int)Math.ceil(h));
  }
 else {
    return renderToPicture(DEFAULT_PICTURE_WIDTH,DEFAULT_PICTURE_HEIGHT);
  }
}

public Picture renderToPicture ( ) { Length width = rootElement . width ; if ( width != null ) { float w = width . floatValue ( this . renderDPI ) ; float h ; Box rootViewBox = rootElement . viewBox ; if ( rootViewBox != null ) { h = w * rootViewBox . height / rootViewBox . width ; } else { Length height = rootElement . height ; if ( height != null ) { h = height . floatValue ( this . renderDPI ) ; } else { h = w ; } } return renderToPicture ( ( int ) Math . ceil ( w ) , ( int ) Math . ceil ( h ) ) ; } else { return renderToPicture ( DEFAULT_PICTURE_WIDTH , DEFAULT_PICTURE_HEIGHT ) ; } }
renders this svg document to a picture object . < p / > an attempt will be made to determine a suitable initial viewport from the contents of the svg file . if an appropriate viewport can ' t be determined , a default viewport of 512x512 will be used .
