Download it now!
Bug 105588 - SVG exported from Impress or Draw cannot be correctly inserted as an image into another document
Summary: SVG exported from Impress or Draw cannot be correctly inserted as an image in...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
Keywords: bibisectNotNeeded, regression
Depends on:
Blocks: SVG-Save
  Show dependency treegraph
Reported: 2017-01-28 22:34 UTC by peter.sebregondi
Modified: 2020-06-14 13:32 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description peter.sebregondi 2017-01-28 22:34:47 UTC
I have opened a pptx in Impress. Then I have exported a drawing group as a selection in SVG format. 
This SVG (created by Impress) can be opened in the Windows Edge browser and looks good. 
However, when I try to insert this SVG in a docx or odt in Writer, only a little anchor and a little green square are shown. The anchor and the square disappear when I click into the text.

A test with an Inkscape SVG showed that it can be inserted in both a docx and an odt in Writer.
Disabling OpenGL did not help. 
So, inserting an Inkscape SVG in Writer works, but inserting an Impress SVG works not. 

Steps to Reproduce:
1.Steps are described in the description.
2.I went through the same steps 4x

Actual Results:  
See description

Expected Results:
Writer should have successfully inserted the Impress-SVG both in docx and odt.

Reproducible: Always

User Profile Reset: No

Additional Info:

User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36
Comment 1 V Stuart Foote 2017-01-29 01:12:57 UTC
On Windows 10 Pro 64-bit en-US with
Version: (x64)
Build ID: 7074905676c47b82bbcfbea1aeefc84afe1c50e1
CPU Threads: 8; OS Version: Windows 6.19; UI Render: GL; Layout Engine: new; 
Locale: en-US (en_US); Calc: group

Confirmed. But it is not limited to opening a PPTX document into Impress and selecting draw objects.

Rather you can simply create a new blank slide, adding Draw objects with text annotation, and Text boxes--selection of a group of objects and Exporting as SVG results in an .SVG image that does not cleanly render back to a Draw or Writer document canvas.

But issue also happens when exporting the entire slide--so not limited to export of selection ( ) rather it seems more like some import filter misformatting reading the extent of the SVG

Edge, Internet Explorer, Firefox have no issue with opening the SVG. Imagemagik's IMDisplay viewer renders it blank. Inkscape opens it but with large pixel counts, e.g. 22k x 30k size. 

Draw will open the SVG (either the selection or the full slide) but no text annotations.

Inserting the SVG in LO modules: it reads a diminutive extent on the document canvas for Writer as noted in OP, while insert into Draw or Impress shows nothing.

So not clear if the issue is the export filter, or the import filter or a combination of both.
Comment 2 Iain Waugh 2017-01-29 05:57:03 UTC
I am also seeing this bug.  It used to work in LibreOffice v5.1.3, but wasn't working in 5.2.1.

As a side note, a Draw SVG export from v5.1.3 uses 24kB; the same export from v5.2.1 uses 300kB.  Most of the extra size is taken up with Javascript.
Comment 3 Regina Henschel 2017-01-29 22:55:29 UTC
Search for attribute "visibility" in the svg file. It has the wrong value "hidden". Exchange for example
<g visibility="hidden">
<g visibility="visible">

Then the import should work.

Please report back, whether such repaired svg will import in your case too.
Comment 4 V Stuart Foote 2017-01-30 02:47:20 UTC
(In reply to Regina Henschel from comment #3)
> Search for attribute "visibility" in the svg file. It has the wrong value
> "hidden". Exchange for example
> <g visibility="hidden">
> with
> <g visibility="visible">
> Then the import should work.
> Please report back, whether such repaired svg will import in your case too.

Yes. If I edit the SVG in text editor (VI) and set the <g class="SlideGroup"> object's <g visibility="hidden"> to <g visibility="visible"> the SVG inserts into Draw/Impress and Writer cleanly.

Checked a export to SVG, the <g visibility=""> is not set.
Comment 5 peter.sebregondi 2017-01-30 10:08:47 UTC
Exporting a selection of a pptx slide in Impress does not work anymore. 
A 366KB SVG is created, but both Microsoft Edge and Chrome bring the same error message: "An unexpected error occurred. The presentation engine will be stopped". 
However, exporting the whole slide still works, it creates a 367KB SVG.
Comment 6 peter.sebregondi 2017-01-30 11:07:07 UTC
On another PC, in Writer, the Impress5.2.4.2-selection-SVG was inserted in a docx, but only the text, no graphical elements such as shapes.
Comment 7 peter.sebregondi 2017-01-30 16:39:39 UTC
An Impress selection SVG export (from a pptx drawing group) is shown correctly in Inkscape 0.92.
Chrome and Edge cannot handle this selection SVG, however.
Comment 8 peter.sebregondi 2017-01-30 19:45:21 UTC
Writer does not insert any SVG that was exported from a pptx in Impress
Comment 9 Regina Henschel 2017-01-31 14:25:19 UTC
There exist several problems in svg export. I have written the bugs 105636, 105639, 105641 and 105642 for some of them. So this bug should be for the false "hidden" value.

This false value is set in method SVGFilter::implExportDrawPages in file filter/source/svg/svgexport.cxx around line 1503.

Unfortunately setting the default to "visible" will show all slides together when the file is opened in a browser. So that would not fix the problem.

I expected, that the first slide - and in case of a selection of single objects the only one - is set to "visible" and only the other slides are set to "hidden".

I think, that there is a real bug, because the comment there,
 "// In case the exported slides are more than one the initial
  // visibility of each slide is set to 'hidden'. "
indicates, that the expected behavior was intended for a selection of objects. But it doesn't work.
Comment 10 QA Administrators 2018-02-01 03:44:38 UTC Comment hidden (obsolete)
Comment 11 ion_nsk_region 2020-06-03 07:18:39 UTC
The bug is still actual for LibreOffice Impress Version:
Selection of objects is exported as SVG with 
<g visibility="hidden">
Image is shown as blank white page in browsers (Firefox 76.0.1, Chromium 81.0.4044.138).
When image inserted back to Impress, it is not shown as all.
When image inserted into Writer, there are green squares for resizing (located almost one onto another) and anchor, but still, there is no image content.
If I set 
<g visibility="visible">
then image is properly shown in browsers. However, upon saving in Inkscape as Inkscape SVG, it become hidden again. Upon saving as optimized SVG, image content is visible and working fine for browsers, and for import to Impress.