When I copy and paste an object with a relative Href attached to it (e.g. ../bar/index.html) I end up with an absolute Href (e.g. file:///home/me/foo/bar/index.html). Is there a way of retaining the relative Href?
I should have been clearer - I am copying and pasting multiple objects between documents . You are right duplicating an object within a document keeps the relative Href.
I'm using Inkscape 1.3.2 (Fedora/Linux) and that's not the behaviour I'm getting. Pasting changes the path from relative to absolute and it remains absolute after saving.
Attached graphic may make clearer the behaviour I'm seeing and what I'm trying to achieve (let me know if it clarifies things!)
That set me on the right path, thanks. "Store absolute path" was unchecked, but it made me try importing rather than copy/paste. Importing maintains the relative paths. I can maintain all my objects that have Hrefs on a separate page and then import that page into other pages as needed. Thanks again!
When I copy and paste an object with a relative Href attached to it (e.g. ../bar/index.html) I end up with an absolute Href (e.g. file:///home/me/foo/bar/index.html). Is there a way of retaining the relative Href?
If you click on the image and then Edit>XML Editor
There is an icon to "duplicate node" as show in the attached image.
Note: sometimes it is greyed out in the XML Editor.
If it is greyed out just click the nearest element in the XML Editor then click back on the image entry.
It should duplicate without changing the href path.
In fact that was more complicated than necessary.
Edit>Duplicate does the same thingΒ !
I should have been clearer - I am copying and pasting multiple objects between documents . You are right duplicating an object within a document keeps the relative Href.
I have tested on windows.
If you hit Ctrl + s to save the file after pasting, it seems to update to a relative path.
I'm using Inkscape 1.3.2 (Fedora/Linux) and that's not the behaviour I'm getting. Pasting changes the path from relative to absolute and it remains absolute after saving.
Attached graphic may make clearer the behaviour I'm seeing and what I'm trying to achieve (let me know if it clarifies things!)
I get the correct behaviour (same as windows) in Ubuntu 22 with Inkscape 1.3
Can you check if you have Edit>Preferences>Imported Images>Store Absolute Filepath For Linked Images is unchecked ?Β
Otherwise the solution would be to raise and issue on gitlab
Or write an extension to compare current svg filepath with link filepath and rewrite to relative.
That set me on the right path, thanks. "Store absolute path" was unchecked, but it made me try importing rather than copy/paste. Importing maintains the relative paths. I can maintain all my objects that have Hrefs on a separate page and then import that page into other pages as needed. Thanks again!