freegroup / draw2d

Create Visio like drawings, diagrams or workflows with JavaScript and HTML5
https://freegroup.github.io/draw2d/#/examples
MIT License
734 stars 226 forks source link

Using own svg as content #210

Open MoaLaiSkirulais opened 2 years ago

MoaLaiSkirulais commented 2 years ago

Is it possible to put a barcode svg inside a shape and handle like any shape?

I need to put this content inside a shape:

<svg id="barcode" width="332px" height="140px" x="0px" y="0px" viewBox="0 0 332 140" xmlns="http://www.w3.org/2000/svg" version="1.1" style="transform: translate(0px, 0px); background: rgb(255, 255, 255);"><g transform="translate(10, 10)" style="fill:#000000;"><rect x="0" y="0" width="4" height="100"></rect><rect x="6" y="0" width="2" height="100"></rect><rect x="12" y="0" width="2" height="100"></rect><rect x="22" y="0" width="2" height="100"></rect><rect x="30" y="0" width="4" height="100"></rect><rect x="36" y="0" width="2" height="100"></rect><rect x="44" y="0" width="8" height="100"></rect><rect x="56" y="0" width="2" height="100"></rect><rect x="62" y="0" width="2" height="100"></rect><rect x="66" y="0" width="2" height="100"></rect><rect x="72" y="0" width="2" height="100"></rect><rect x="76" y="0" width="4" height="100"></rect><rect x="88" y="0" width="8" height="100"></rect><rect x="98" y="0" width="6" height="100"></rect><rect x="106" y="0" width="2" height="100"></rect><rect x="110" y="0" width="2" height="100"></rect><rect x="114" y="0" width="2" height="100"></rect><rect x="120" y="0" width="8" height="100"></rect><rect x="132" y="0" width="4" height="100"></rect><rect x="140" y="0" width="2" height="100"></rect><rect x="144" y="0" width="2" height="100"></rect><rect x="154" y="0" width="2" height="100"></rect><rect x="158" y="0" width="4" height="100"></rect><rect x="166" y="0" width="2" height="100"></rect><rect x="176" y="0" width="4" height="100"></rect><rect x="182" y="0" width="4" height="100"></rect><rect x="190" y="0" width="4" height="100"></rect><rect x="198" y="0" width="2" height="100"></rect><rect x="202" y="0" width="6" height="100"></rect><rect x="210" y="0" width="8" height="100"></rect><rect x="220" y="0" width="2" height="100"></rect><rect x="224" y="0" width="4" height="100"></rect><rect x="232" y="0" width="6" height="100"></rect><rect x="242" y="0" width="2" height="100"></rect><rect x="250" y="0" width="2" height="100"></rect><rect x="254" y="0" width="4" height="100"></rect><rect x="264" y="0" width="2" height="100"></rect><rect x="268" y="0" width="4" height="100"></rect><rect x="274" y="0" width="6" height="100"></rect><rect x="286" y="0" width="4" height="100"></rect><rect x="296" y="0" width="6" height="100"></rect><rect x="304" y="0" width="2" height="100"></rect><rect x="308" y="0" width="4" height="100"></rect><text style="font: 20px monospace" text-anchor="middle" x="156" y="120">Example 1234</text></g></svg>

Rendered as: image

thnx

snakex64 commented 1 year ago

Did you ever manage to make this work ?