How to get Inkscape to respects units of external SVG?

Post questions on how to use or achieve an effect in Inkscape.
chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

How to get Inkscape to respects units of external SVG?

Postby chrisjj » Fri Apr 12, 2013 9:16 am

What do I need to do to Inskscape or to this SVG to make Inskscape respect the 'mm' choice of units?

Code: Select all

<?xml version='1.0' standalone='no'?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg width="1000mm" height="10mm">
<polygon points='0.00,0.00 0.00,10.00 1000.00,10.00 1000.00,0.00 ' fill='black' />
 </svg>


Currently inkscape V0.48.4 apparently interprets the dimensions as px, despite the containing entity <svg> specifying mm:

Image

and changing Inkscape display to mm causes an unwanted scaling:

Image

I have read the comments to https://bugs.launchpad.net/inkscape/+bug/657284 and am none the wiser.

Thanks.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: How to get Inkscape to respects units of external SVG?

Postby ragstian » Fri Apr 12, 2013 2:42 pm

Hi

Try this;

Code: Select all

<?xml version='1.0' standalone='no'?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN'
   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="1000mm" height="10mm" viewBox="0 0 1000 10"
   xmlns="http://www.w3.org/2000/svg" version="1.1">
   <polygon fill="black" stroke="blue" stroke-width="0"
            points="0.00,0.00 0.00,10.00 1000.00,10.00 1000.00,0.00" />
</svg>


Set document properties Units = mm

For example - see here; http://www.w3.org/TR/SVG/shapes.html

Good Luck
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: How to get Inkscape to respects units of external SVG?

Postby chrisjj » Thu Apr 18, 2013 4:29 am

ragstian wrote:

Code: Select all

<?xml version='1.0' standalone='no'?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN'
   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="1000mm" height="10mm" viewBox="0 0 1000 10"
   xmlns="http://www.w3.org/2000/svg" version="1.1">
   <polygon fill="black" stroke="blue" stroke-width="0"
            points="0.00,0.00 0.00,10.00 1000.00,10.00 1000.00,0.00" />
</svg>



Thanks. Adding viewBox works. It seems Inskscape is ignoring the <svg units indication unless there is a viewBox. Ratehr poor.

ragstian wrote:Set document properties Units = mm


Thanks, but with the workaround above, i find that is no needed.

ragstian wrote:For example - see here; http://www.w3.org/TR/SVG/shapes.html


I don't see anything there (or anywhere else in the SVG spec.) to suggest this behaviour.
Good Luck
RGDS
Ragnar[/quote]


Return to “Help with using Inkscape”