SVG to DXF problem with svg <symbol> ( and <use> tag)

Hello,
We are triying to convert SVG containing and to dxf.
It looks like the aspose converter does not support this usage.
The symbol is just drawn as a path and the tags does not appear on the dxf.
Here is an example:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="400" height="1100" viewBox="-200,-400,400,1100">
  <defs>
    <symbol viewBox="-10.88261,-10.88261,21.76522,21.76522" id="symbol-1">
      <path d="M-10,0c0,-5.52285 4.47715,-10 10,-10c5.52285,0 10,4.47715 10,10c0,5.52285 -4.47715,10 -10,10c-5.52285,0 -10,-4.47715 -10,-10z" fill="#e9e9e9" fill-rule="nonzero" stroke="#bbbbbb" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" vector-effect="non-scaling-stroke" stroke-miterlimit="10" stroke-dasharray="none" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"/>
    </symbol>
  </defs>
  <g id="SYMBOLUSE" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal">
    <g id="650587a0-75ce-4315-8d47-c7b48c9e2c48">
      <use x="-275.88261" y="-65.88261" xlink:href="#symbol-1" width="21.76522" height="21.76522" overflow="visible" fill="none" stroke="none"/>
      <use x="-125.88261" y="-255.88261" xlink:href="#symbol-1" width="21.76522" height="21.76522" overflow="visible" fill="none" stroke="none"/>
      <use x="-125.88261" y="-65.88261" xlink:href="#symbol-1" width="21.76522" height="21.76522" overflow="visible" fill="none" stroke="none"/>
      <use x="24.11739" y="-255.88261" xlink:href="#symbol-1" width="21.76522" height="21.76522" overflow="visible" fill="none" stroke="none"/>
      <use x="24.11739" y="-65.88261" xlink:href="#symbol-1" width="21.76522" height="21.76522" overflow="visible" fill="none" stroke="none"/>
      <use x="174.11739" y="-255.88261" xlink:href="#symbol-1" width="21.76522" height="21.76522" overflow="visible" fill="none" stroke="none"/>
      <use x="174.11739" y="-65.88261" xlink:href="#symbol-1" width="21.76522" height="21.76522" overflow="visible" fill="none" stroke="none"/>
      <use x="324.11739" y="-255.88261" xlink:href="#symbol-1" width="21.76522" height="21.76522" overflow="visible" fill="none" stroke="none"/>
    </g>
  </g>
  <text id="INFOTEXT" x="0" y="100" font-size="50"><tspan x="0" dy="0">Hello</tspan><tspan x="0" dy="50"/>
<tspan x="0" dy="100">ASPOSE</tspan><tspan x="0" dy="150"/>
</text>
</svg>

Here is the svg preview:
SVG preview (8.9 KB)

And here is the DXF result:
DXF Preview (32.0 KB)

You can clearly see that the multiple circles are missing and the symbol is drawn although it should not be.

Is it possible to fix that somehow?

I see that xlink:href is deprecated. I tried it with href instead but it does not work either:
Alternate DXF Preview (43.3 KB)
Even the symbol is not drawn (which is quite better in the end…).

Thanks in advance for your support.

@Ancotech

You’re seeing the definition rendered as a single path while all instances are missing because the current Aspose.CAD SVG‑to‑DXF conversion does not expand / references (this is based on your observation).

What you can do

  1. Flatten the SVG before conversion – use an SVG editor or library (e.g., Inkscape → File → Save As → Plain SVG or any tool that can replace each with the actual content of the referenced ). The resulting SVG will contain only concrete elements, which the converter handles correctly.

  2. Convert the flattened SVG – call the normal conversion API, such as PostDrawingSaveAs as shown in the forum example .

  3. Why changing href doesn’t help – the converter’s SVG parser still expects the legacy xlink:href attribute, so switching to plain href does not affect the missing instances.

At present there is no conversion option that enables native / support; the reliable workaround is to preprocess the SVG to remove those elements before invoking the Aspose.CAD API.

I know that it is an AI response but, the first point should not be an option. We may be able to transform symbols to path in Javascript before the api call but this clutter the code a lot and may lead to problems, and it makes the svg bigger.

@Ancotech,
Hello,
let us investigate this case and come back.

1 Like