如何从SVG文件转换图像(包括Base64图像)

时间:2018-11-21 05:11:45

标签: java svg batik

我想从SVG(HTML包括两个Base64)创建图像。 非常感谢! 我的代码只是将图像转换为普通的SVG。

<svg xmlns='http://www.w3.org/2000/svg' id='svg' height='145' width='246' class='hy'><defs></defs><g>

    <g id='1g_title'>
    <image xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUpj/THVf05z1zx+lHc7W/edCDRnQpv4344pwCLtmmRa9qOZlvhp9pSaPN8HiMZ+5133gF5nwMHDmDixIlcDY4YMQIz0tLcVZlHM5V+V/AwvbQZrNvTJDZLuEOY6Kc5HWInckeg7+2FcNOB5Pn4FVf+I1eVxhjqH48sxXFCRusObfqqjV/rnk0kG1ZS+uECqzaZrEnSnrAmr9Pbk9EVrtxgoo2gwjOzIkG/8DTve1UF29XFb/DzfwAFpfpM55BByAAAAABJRU5ErkJggg==' preserveAspectRatio='none' x='3' y='3' width='240' height='44'>
    </image>
    </g>
    <g id='1g_InN'>
    <image xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAmYAAAJmCAYAAAD2LEyKAAAgAElEQVR4Xux9B5hdV3Xuf+ot06XRSBpZlmy5CvcCuGBcMMSUkPpI8kjeeyGPvOQRSiimmWIDdmimOg4JIeFBAIeSkNADMcaACzau4CIXWb1Mn7nl1Pf9a+1975UsAiACItA3AhJmfVAIiIAJ9IyBh1rcV13xFQAREQAREQAQ6S0DCrLNLo4GJgAiIgAiIgAj0jYCEWd9WXPMVAREQAREQARHoLAEJs84ujQYmAiIgAiIgAiLQNwISZn1bcc1XBERABERABESgswQkzDq7NBqYCIiACIiACIhA3whImPVtxTVfERABERABERCBzhKQMOvs0mhgIiACIiACIiACfSPwfwJdb/C3MkJ6AAAAAElFTkSuQmCC' preserveAspectRatio='none' x='82.5' y='55' width='80' height='80' id='img-1'>
    </image>
    </g>
    <g id='ed'><text xml:space='preserve' class='text' x='0' y='55' style='font-family: &quot;MS 明朝&quot;; text-anchor: end;' data-fill='red' fill='red'><tspan class='tspan' x='75' y='63.775' style='font-size:7.700000000000008pt;'><tspan style='font-size: 7.700000000000008pt;font-family: MS 明朝'>Address</tspan></tspan></text>
    <text xml:space='preserve' class='text' x='0' y='65' style='font-family: &quot;MS 明朝&quot;; text-anchor: end;' data-fill='blue' fill='blue'><tspan class='tspan' x='75' y='73.775' style='font-size:7.700000000000008pt;'>
    <tspan style='font-size: 7.700000000000008pt;font-family: MS 明朝'>xxxxx</tspan></tspan></text>
    <text xml:space='preserve' class='text' x='170' y='55' style='font-family: &quot;MS 明朝&quot;; text-anchor: start;' data-fill='Black' fill='Black'>
    <tspan class='tspan' x='170' y='63.775' style='font-size:7.700000000000008pt;'>
    <tspan style='font-size: 7.700000000000008pt;font-family: MS 明朝'>Address</tspan></tspan>
    </text>
    <text xml:space='preserve' class='text' x='170' y='65' style='font-family: &quot;MS 明朝&quot;; text-anchor: start;' data-fill='Yellow' fill='Yellow'><tspan class='tspan' x='170' y='73.775' style='font-size:7.700000000000008pt;'><tspan style='font-size: 7.700000000000008pt;font-family: MS 明朝'>ccccc</tspan>
    </tspan>
    </text>
    </g>
    </g>

</svg>

0 个答案:

没有答案