Comment 4 for bug 657284

Revision history for this message
su_v (suv-lp) wrote :

> So I was not able to come up with a meaningful
> definition of document size and used 100% only
> for lack of something better.

Uneducated guess: maybe the DXF entities '$EXTMIN' and '$EXTMAX' could be used to set the document size (width/height attributes of the top-level <svg> element) if automatic scaling is off, either directly in mm (as do the default Inkscape templates e.g. for A4), or unitless (after applying the conversion from mm to Inkscape user units (px, based on 90dpi))? They seem to be used for absolute positioning anyway if the scale factor isn't 1.0 (but e.g. 10.0 or 100.0) - at least in some DXF files I found on my disk from earlier bug reports.

(Note: last time I had to deal with DXF and DWG files is years ago (I forgot what I used to know about the details) - this is just an guess after taking a quick look at the python script for dxf_input).

On the other hand you could set the size to the default A4 dimensions (in mm) explicitly - this seems to be how Inkscape (apparently unlike other SVG viewers) interprets the 100% of the width/height <svg> attributes anyway. Then the user can zoom to the drawing content and - if absolute distance to the coordinate system origin is not important - resize the page to the drawing content.

Ideally an offset between the coordinate origin and lower left corner of the page would be defined with a viewBox attribute, but the viewBox attribute is not yet fully supported by Inkscape (whereas widely used e.g. in SVG files from Openstreetmap or other GIS applications, afaiu).

The page size issue doesn't prevent from setting a metric unit (e.g. 'mm') for the default units though, nor for using it for the grid.