Bug 144869 - Feature Request: extra SVG export option that groups objects by layer (for compatibility with e.g. Inkscape)
Summary: Feature Request: extra SVG export option that groups objects by layer (for co...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.2.1.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:svg
Depends on:
Blocks: Layers SVG-Save
  Show dependency treegraph
 
Reported: 2021-10-02 08:22 UTC by 1820204_1
Modified: 2023-12-07 09:35 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 1820204_1 2021-10-02 08:22:20 UTC
Description:
This request is based on Bug 144848, which is obviously related to a non standard usage of layers within SVG format from other programs such as Inkscape or Sozi Presenter

The idea is to have another import / export filter of non-standard SVG-Files in order to use DRAW files within Inkscape and Sozi Presenter.

Steps to Reproduce:
Steps to Reproduce:
1.Create 2+ layers within draw 
2.Place a shape on each layer
3.Export the slide to a SVG file (File - Export ... name + SVG Format)
4.Import the file to a program for further processing e.g.  Sozi Presenter or Inkscape

Actual Results:
Layers crated by DRAW are not available in Inkscape / Sozi Presenter
All shapes are merged to one shape and can not be selected individually

Expected Results:
Additional export format which allows the layers to be used in Sozi / Inkscape.


Reproducible: Always


User Profile Reset: No



Additional Info:
Have an additional export / import format for SVG
Comment 1 AndyG 2022-03-25 09:18:10 UTC
I've observed the same behavior, but haven't paid great attention to it yet.

Note that currently LO Draw exports SVG in two different versions. If you export manually (menu: File > Export...) it will export in SVG v1.2. But if you export from an OOO Basic macro, it will export in SVG1.1. The two SVG files look radically different.

For SVG export problems, you probably need to specify how you exported the file.

I also think that improvements should only be made in v1.2. I'm planning to file a bug report for macros using v1.1.

AndyG
Comment 2 1820204_1 2022-03-25 13:22:48 UTC
Hi Andy and Thank you for answering. I am sorry, I do not know what the different export methods are. I do not remember to have any basic macro installed.

What I did was always under "File -> Export ... " (The one above "Export as" where you can create PDFs.

What is tha macro-thing?
Comment 3 AndyG 2022-03-27 23:29:49 UTC
If you don't remember having a macro installed, you definitively have exported the SVG manually :-)

I have now reported and documented the behavior in bug report 148178

Andy
Comment 4 Stéphane Guillou (stragu) 2023-12-07 08:31:44 UTC
Thanks for the suggestion!

I was going to mark as duplicate of bug 95717, but I now understand it's not the same request. Seeing Regina's comments in bug 144848 comment 3 and bug 95717 comment 9, it's not possible to add the same grouping logic as e.g. Inkscape to our existing filter because it would interfere with our grouping of objects spanning several layers.

So the extra filter would be an alternative to the standard SVG filter, which would remove object grouping (currently done with <g class="Group">) - at least when they span several layers – and replace them with grouping by layer.

Based on what is suggested in bug 95717 comment 2, which is based on Inkscape's tagging, it could look like:

 <g
     id="layer2"
     libreOfficeDraw:groupmode="layer"
     libreOfficeDraw:label="The Layer Name"
     [...]

If implemented, it should be clearly labelled, something like "SVG (group objects by layer)".
Alternatively, instead of an extra filter (we already have a list that's too long...), could it be an option in the export dialog, labelled something like "Group by layer" and a tooltip like:

"Grouping by layer removes current object grouping (if they span several layers) but improves compatibility with other tools".

I assume other tools like Inkscape would also need to update their import filter to catch such layering.

Regina, Xisco, Heiko, what do you think?
Comment 5 Heiko Tietze 2023-12-07 09:04:40 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> Alternatively, instead of an extra filter (we already have a list that's too
> long...), could it be an option in the export dialog, labelled something
> like "Group by layer" and a tooltip like:

^ this (no extra filter)

Does the scenario justify the effort?
Comment 6 Stéphane Guillou (stragu) 2023-12-07 09:35:35 UTC
(In reply to Heiko Tietze from comment #5)
> ^ this (no extra filter)
> 
> Does the scenario justify the effort?
Because I value interoperability between FLOSS tools, and because there was recent interest in improving how Inkscape and LO work together in particular, my vote is "yes".
I changed the summary to prefer "option" over "extra filter".