Hello,
I have created byte array in the memory of some SVG image. (source of byte array :: The APIs are third party api interfaced with C objects. so all I have received though this JNI APIs is the byte array.)
I would like to convert byte array to SVG or PNG file. Please remember that input is already defined as SVG image's byte array.
Please let me know if anyone has already solved this puzzle.
final byte[] imagebytes = getValueAsByteArray(streamId); // This call is third party API call nothing much can be done. imgebytes are of SVG type
Would like to create image file (SVG, PNG etc) from the above input.
--- Update ---
More progress ---
when I print the bytearray this is what it shows me :--
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="16mm" height="18mm" viewBox="0 0 1639 1800" xmlns="http://www.w3.org/2000/svg">
<desc>Image produced by Accelrys Accord Chemistry SDK</desc>
<g>
<line x1="299.99" y1="599.97" x2="299.99" y2="1199.93" stroke="rgb(0,0,0)" stroke-width="18.00"/>
<line x1="299.99" y1="1199.93" x2="819.59" y2="1499.91" stroke="rgb(0,0,0)" stroke-width="18.00"/>
<line x1="819.59" y1="1499.91" x2="1339.20" y2="1199.93" stroke="rgb(0,0,0)" stroke-width="18.00"/>
<line x1="1339.20" y1="1199.93" x2="1339.20" y2="599.97" stroke="rgb(0,0,0)" stroke-width="18.00"/>
<line x1="1339.20" y1="599.97" x2="819.59" y2="299.99" stroke="rgb(0,0,0)" stroke-width="18.00"/>
<line x1="819.59" y1="299.99" x2="299.99" y2="599.97" stroke="rgb(0,0,0)" stroke-width="18.00"/>
</g>
</svg>
I have convert the above data into SVG format.