How to convert SVG into PNG on-the-fly
I try to convert an svg into PNG. the svg document is coming from a server as an Inputstream . First, I convert the svg stream into byte array with: byte[] streamBytes = IOUtils.toByteArray(svgStream); Then I convert the bytes into OutputStream (PNG) with the following code. private ByteArrayOutputStream svgToPng(byte[] streamBytes) throws TranscoderException, IOException { PNGTranscoder t = new PNGTranscoder(); TranscoderInput input = new TranscoderInput(new ByteArrayInputStream(streamBytes)); ByteArrayOutputStream ostream = new ByteArrayOutputStream(); TranscoderOutput output = new