//svgRoot.setAttributeNS(null, "viewBox", "0 0 " + pageWidth + " " + pageHeight);
SVGTranscoder svgT = new SVGTranscoder();
TranscoderInput input = new TranscoderInput(svgDocument);
TranscoderOutput output = new TranscoderOutput(new OutputStreamWriter(outputStream));
try {
svgT.transcode(input, output);
} catch(TranscoderException e) {
log.error("could not write svg file :" + e.getMessage(), e);
}
outputStream.flush();