Inkscape.org
Beginners' Questions SVG relative coordinates export
  1. #1
    innerground innerground @innerground

    Dear all,

    When I export an SVG (using the current last version of Inkscape), the coordinates are absolute (expressed in pixels), I need to export the file using relative coordinates as the view box might change.

    Is that possible?I have seen an option (in version 0.48) called 'Allow relative coordinates' but it seems that It has been removed from latest version.

    Thanks for your help,

    Inkscape is great!

     

  2. #2
    Patrick Storz Patrick Storz @Ede_123

    The preference you're looking for is still present in current versions of Inkscape, see
    "Input/Output > Svg output > Path data -> Path string format"

  3. #3
    innerground innerground @innerground

    Dear Patrick,

    Thank you for your answer.I tryied that, but the coordinates of the text are still in pixels.

    Basically, I want the text to stay at the same position whatever I set portrait or landscape, but that does not work.

    Any idea?

    Should I use a matrix or so?

    Thanks,

  4. #4
    Flamingolady Flamingolady @flamingoladyπŸ¦©βš–

    Just to comment, not sure if this will help or not, because I may not be following this correctly - are you exporting as a png?  If so, there is a dropdown box called Units where you can chg from px, on the export menu.

  5. #5
    brynn brynn @brynn

    Fyi I moved a message from betdy1345 out of this topic into its own topic, since it was not related.  Please find it here:  https://inkscape.org/forums/questions/help-with-makerbot-unicorn-gcode/

  6. #6
    Patrick Storz Patrick Storz @Ede_123
    *

    I'm still having trouble to understand the actual issue here.

    Elements always have absolute coordinates in an SVG document. Even in paths written using relative coordinates the first coordinate pair will be interpreted as an absolute coordinate to position the rest of the path properly. How should the SVG renderer even now where to put a shape otherwise?

    Maybe try to explain what you actually want to achieve (ideally give an example), otherwise I don't see how we could help.

     

    P.S.: If you see your text moving vertically when changing page size, that's expected behavior.

    It will be possible to avoid this starting with Inkscape 1.0 which allows to put the origin in the upper left of the page, with the y-axis facing down (i.e. opposite to what Inkscape used to do historically).

  7. #7
    xnadernader xnadernader @xnadernader

    As of Inkscape 1.0.1 there is a preference under Edit > Preferences > Input/Output > SVG Output.Β  For the Path data "Path string format", select "Relative".Β  Then you need to modify your image position to trigger updating the paths to relative. In my case I had an svg icon. I selected all paths and slid them left by 1px. This resulted in all svg paths being converted to relative. They were actually mixed absolute and relative prior to changing this preference.

    Good Luck!

  8. #8
    Vojta Vojta @Vojta

    Hi, i faced similar problem. I needed all coordinates keep between 0 and 1. My solution was to change document size (in Document Properties) to 1x1 pixel...

Inkscape Inkscape.org Inkscape Forum Beginners' Questions SVG relative coordinates export