Hi,

I have a js which converts embed tag to svg tag. Is it possible to create a
generic batik class which parse this embed tag and stores the svg tag into a
file.

Input:

<embed type='image/svg+xml' align='middle' width='250' height='250' src='
/javascript/d.svg <view-source:http://maths.ac/javascript/d.svg>'
script='initPicture(-10,130,-10,130);stroke="black";fill="gray";strokewidth=1;rect([0,0],[70,60]);rect([70,0],[100,100]);text([70/2,60+6],"7y
cm");text([85,106],"12 cm");text([70,60/2],"6y cm",right);text([100,50],"16y
cm",right);' />

Expected output: into a file

<svg oy="17.857142857142858" ox="17.857142857142858" ymax="130" ymin="-10"
xmax="130" xmin="-10" yunitlength="1.7857142857142858"
xunitlength="1.7857142857142858"
height="250" width="250" style="display: inline;" id=""><circle fill="red" r
="0.5" cy="0" cx="0" id="pointerpos"></circle><rect style="stroke-width: 1;
fill: white;" height="250" width="250" y="0" x="0"></rect><rect fill="gray"
stroke="black" stroke-width="1" height="107.14285714285715"
width="125" y="124.99999999999997"
x="17.857142857142858" id="undefined"></rect><rect fill="gray" stroke="black"
stroke-width="1" height="178.57142857142858" width="53.57142857142858"
y="53.571428571428555"
x="142.85714285714286" id="undefined"></rect><text stroke-width="0px"
fill="black"
stroke="black" text-anchor="middle" font-weight="normal" font-size="16"
font-family="times" font-style="italic" y="119.619" x="80.3571" id=
"undefined">7y cm</text><text stroke-width="0px" fill="black" stroke="black"
text-anchor="middle" font-weight="normal" font-size="16" font-family="times"
font-style="italic" y="48.1905" x="169.643" id="undefined">12
cm</text><textstroke-width
="0px" fill="black" stroke="black" text-anchor="start" font-weight="normal"
font-size="16" font-family="times" font-style="italic" y="183.905" x="148.19"
id="undefined">6y cm</text><text stroke-width="0px" fill="black" stroke="black"
text-anchor="start" font-weight="normal" font-size="16" font-family="times"
font-style="italic" y="148.19" x="201.762" id="undefined">16y cm</text></svg
>

Reply via email to