I am encountering an issue related to large values when converting a DXF file to an SVG format using the dwg2svg.bat tool.
In my input1.dxf file all values are in meters, but the unit is unset (None).
When I run the conversion with
Code: Select all
dwg2svg.bat -o "_out_g.svg" -g -f "input1.dxf"Code: Select all
<svg width="59.6102" height="63.7185" viewBox="148836.3471 -172593.4875 59.6102 63.7185" ...>When I specify the real unit explicitly by running
Code: Select all
dwg2svg.bat -o "_out_g_m.svg" -g -u m -f "input1.dxf"The _out_g_m.svg file starts with
Code: Select all
<svg width="59610.2445mm" height="63718.5mm" viewBox="148836347.1 -172593487.5 59610.2445 63718.5" ...">Code: Select all
<text x="0" dx="0" y="0" dy="0.3" font-family="ARIAL.TTF" font-size="420" line-height="1.1" fill="#000000" transform="translate(148852681,172557294.3) translate(0,0.3) scale(1,-1)" text-anchor="start">Opp: 9.66 m²</text>Code: Select all
dwg2svg.bat -o "_out_g_m_s.svg" -u m -g -s "1:200" -f "input1.dxf"Code: Select all
<svg width="298.0512mm" height="318.5925mm" viewBox="148836347.1 -172593487.5 59610.2445 63718.5" ...>Code: Select all
<text x="0" dx="0" y="0" dy="0.3" font-family="ARIAL.TTF" font-size="420" line-height="1.1" fill="#000000" transform="translate(148852681,172557294.3) translate(0,0.3) scale(1,-1)" text-anchor="start">Opp: 9.66 m²</text>Ideally, I would like to shift all coordinates by the number of the viewBox's starting point, and set the viewBox to start at simply 0 0. This way, the text’s transform would be more manageable -`translate(16333.9, 36193.2)...`, much better for me and, probably, for browsers.
Could anyone offer guidance on how to adjust the viewBox correctly if possible, or please suggest how to deal with it?
Windows 11, QCAD 3.31.1 pro