The SVG to DXF conversion breaks the scaling of the shapes

Hello,

So our app has been using the SVG to DXF conversion for some months now, with success.
Despite the conversion working, the customers came out to us complaining about the scaling of the DXF files.

There is indeed a scaling problem in the resulting DXF. The distances are not the same as is the PDF. We tried to play with the zoom/viewBox but the scaling of the result DXF file seems very inconsistent. Even deleting an element to simplify the SVG gave me some different scaling.

Here is a picture of the input SVG, which only contains a 400x300mm green rectangle:
image.png (79.6 KB)

Here is the output DXF from your service, and you can see the measure shows wrong results (quite a big difference for this occurrence):
image.png (112.7 KB)

Just for the extra information, here is the exact same SVG file but without the “width” and “height” in the SVG tag, and the DXF output still show a different measure:
image.png (111.8 KB)

Our app is a very precise construction dimensioning. As it is currently in production, we can’t afford to provide that kind of DXF export. We need either a quick workaround or a quick fix, or we’ll need to consider converting the DXF ourselves :'(.

Hopefully we can find a solution together. Good luck with this one.

@Ancotech

Can you please provide the code or method you are using for the SVG to DXF conversion? Additionally, what version of the Aspose.CAD library are you using?

Our production app is using aspose-cad-cloud v24.5.2 for Java, but the results are equally inconsistent with your online tool.

@Ancotech,
Hi.
Preserving physical dimensions during conversions is tricky because of differences between formats. If we are not mistaken, the default units for SVG are pixels, we don’t see mm units after brief looking at your file, so it seems for this example we are talking about 400x300 pixels. Let us check if we can do such conversion and come back with more information. It could be helpful for us if you can attach the DXF options you are using on your side for conversion.

@Ancotech,
Hello,
we need your further clarifications on the problem.

  1. SVG has pixels units by default, but separate units could be set for specific paths there.
  2. DXF R12 which is the result of export has no units by specification (but inches are often assumed as from practice).
  3. As we can guess now you understand the SVG values in mm and measure the result DXF in millimeters also, expecting to see the value 400 as is the initial SVG, is that right?

Could you please attach the initial SVG file and the desired DXF file for it, so we can see exactly what is the required solution for you (the current DXF result could be helpful as well).