Page 1 of 1

TIP: Fixing SVG viewbox

Posted: Tue Sep 17, 2013 3:21 pm
by hungerburg
This tip may be handy for people, that use QCAD to export drawings for display on the web or for print publishing.

Say, you want to make several drawings of different size objects, so that when exported to SVG the objects appear in the same place of a fixed background plane, eg. centered around the CAD origin, regardless how far they extend in any direction. And NOT draw a border around the object. The clue is, to influence, how QCAD calculates the *viewbox* of the exported SVG drawing, and that is after all quite easy:

Just put two points on all the drawings at the outermost top/bottom and left/right coordinates, that you want the plane to span (think of diagonally opposing corners of a bordering rectangle) -- the same place in all the drawings -- and voilĂ , when exported to SVG the viewbox will be made so, that the points are inside, even if "export Points" is set to false in the export dialogue. No border after all.