Inkscape.org
Beginners' Questions Export to SVG in exact dimensions
  1. #1
    abbaswasim abbaswasim @abbaswasim

    I have created a rectangle at position 15, 10 with 20, 30 mm size and when I export it into SVG I am getting the following svg with dimensions ofย ย width="19.957338",ย ย height="29.957338",ย ย x="15.021331" andย y="10.021331". Why are these not saves in the exact integer coordinates?
    ย 

    The attached picture shows the settings and size in Inkscape.

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!-- Created with Inkscape (http://www.inkscape.org/) -->
    
    <svg
       width="210mm"
       height="297mm"
       viewBox="0 0 210 296.99999"
       version="1.1"
       id="svg5"
       inkscape:version="1.2-dev (9ee32be, 2021-06-19)"
       sodipodi:docname="box.svg"
       xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
       xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:svg="http://www.w3.org/2000/svg">
      <sodipodi:namedview
         id="namedview7"
         pagecolor="#ffffff"
         bordercolor="#666666"
         borderopacity="1.0"
         inkscape:pageshadow="2"
         inkscape:pageopacity="0.0"
         inkscape:pagecheckerboard="0"
         inkscape:document-units="mm"
         showgrid="false"
         inkscape:zoom="3.5048376"
         inkscape:cx="61.343784"
         inkscape:cy="119.54905"
         inkscape:window-width="1416"
         inkscape:window-height="1250"
         inkscape:window-x="280"
         inkscape:window-y="30"
         inkscape:window-maximized="0"
         inkscape:current-layer="layer1"
         scale-x="1"
         inkscape:lockguides="false" />
      <defs
         id="defs2" />
      <g
         inkscape:label="Layer 1"
         inkscape:groupmode="layer"
         id="layer1">
        <rect
           style="fill:none;stroke:#000000;stroke-width:0.0426613;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
           id="rect1563"
           width="19.957338"
           height="29.957338"
           x="15.021331"
           y="10.021331" />
      </g>
    </svg>
    

    ย 

    Screenshot 2021 07 15 At 20.22.26
  2. #2
    inklinea inklinea @inklineaโ›ฐ๏ธ
    ๐Ÿ™๐Ÿ‘

    It usually happens when you have a Visual vs a Geometric bounding box set in Inkscape.

    Edit>Preferences>Tools>Bounding Box To Use

    Visual takes the stroke into account. Geometric does not.

  3. #3
    abbaswasim abbaswasim @abbaswasim

    Ah that did it. Thanks a lot.

Inkscape Inkscape.org Inkscape Forum Beginners' Questions Export to SVG in exact dimensions