Bug 82221 - PDF export incorrect with Writer document containing an SVG image
Summary: PDF export incorrect with Writer document containing an SVG image
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
4.2.5.2 release
Hardware: Other macOS (All)
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:pdf
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
 
Reported: 2014-08-06 03:22 UTC by felipe
Modified: 2017-10-28 20:52 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
What gets mangled … (152.71 KB, application/vnd.oasis.opendocument.text)
2014-08-06 03:22 UTC, felipe
Details
The SVG document that was included (9.61 KB, image/svg+xml)
2014-08-06 03:22 UTC, felipe
Details
The mangled PDF (141.84 KB, application/pdf)
2014-08-06 03:23 UTC, felipe
Details
PDF export from LibO 4.2.6 (116.51 KB, application/pdf)
2014-08-06 04:24 UTC, Yousuf Philips (jay) (retired)
Details
non broken PDF (130.87 KB, application/pdf)
2015-09-04 07:32 UTC, steve
Details

Note You need to log in before you can comment on or make changes to this bug.
Description felipe 2014-08-06 03:22:05 UTC
Created attachment 104118 [details]
What gets mangled …

The attached document gets mangled when it exports PDF (attached).
Comment 1 felipe 2014-08-06 03:22:57 UTC
Created attachment 104119 [details]
The SVG document that was included
Comment 2 felipe 2014-08-06 03:23:29 UTC
Created attachment 104120 [details]
The mangled PDF
Comment 3 felipe 2014-08-06 03:24:04 UTC
NOTE: The mangling doesn’t happen if I don’t attach the SVG.

The SVG originates from Finale 2014c, btw.
Comment 4 felipe 2014-08-06 03:25:04 UTC
Also, I get transparency errors when I export to PDF.

Also, if I use the OS’s PDF export feature (“Save as PDF” in the print dialogue), it errors without saving a new file.
Comment 5 Yousuf Philips (jay) (retired) 2014-08-06 04:24:16 UTC
Created attachment 104121 [details]
PDF export from LibO 4.2.6

Hello felipe,

Thank you for submitting the bug. I tested the document on Linux with 4.2.6, 4.3.1 and master and it wasnt a problem. Its possible its not showing for me as i dont have the 'GoudyOlSt BT' font installed.
Comment 6 Yousuf Philips (jay) (retired) 2014-08-06 04:25:25 UTC
I have forward this onto our QA mac team to have a look at.
Comment 7 retired 2014-08-11 07:02:38 UTC
Trying to confirm this bug, the following happened:

* open LO 4.3.0.4 or 4.4.0.0a0+
* Insert > Image > From File
* select SVG (second attachment from this bug)

Result: the svg get's displayed wrong (no notes, but a "w" and a line.

Well, at least when exporting to PDF, I see the same.

Felipe: could you try with LO 4.3.0.4 and see, if you get identical results?

I'm setting this to NEW since either way we have a bug at hand. Either the svg is not displayed correctly (4.3.0.4) or the svg is not correctly exported (4.2.x) the latter which I didn't test and couldn't confirm with 4.3.0.4.
Comment 8 Alex Thurgood 2014-08-11 09:55:41 UTC
Image seems to display and export just fine for me on OSX 10.9.4

Version: 4.4.0.0.alpha0+
Build ID: a0b89100be8ccc2b60d08d7e3819cd247a6042b0

that is my master build
Comment 9 Alex Thurgood 2014-08-11 09:59:43 UTC
I used the posted ODT file for testing. 

SVG image import is known to be buggy, dependent on the svg image properties and the LO module code importing the svg, as far as I understand.
Comment 10 Alex Thurgood 2014-08-11 10:06:55 UTC
Also seems fine on LO 4242, am I perhaps missing something ? What is not being displayed correctly ?
Comment 11 Alex Thurgood 2014-08-11 10:15:14 UTC
Ah, now I see the problem. I downloaded the svg file and then opened it, by default in Safari, which shows the notes on the stave> Firefox, however, shows the same things as LO, hence my confusion.

Confirming that LO incorrectly displays svg file, hence export to pdf also wrong.
Comment 12 Alex Thurgood 2014-08-11 10:20:24 UTC
fwiw, the svg is also correctly displayed in Google Chrome
Comment 13 QA Administrators 2015-09-04 02:48:00 UTC Comment hidden (obsolete)
Comment 14 steve 2015-09-04 07:32:09 UTC
WORKSFORME

OS X 10.10.5
LO Version: 5.1.0.0.alpha1+
Build ID: 50f2c712c46c66264279ab3b61888e491a4d8dca
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2015-09-04_04:59:19
Locale: de-DE (de.UTF-8)

Attaching PDF in non broken form.
Comment 15 steve 2015-09-04 07:32:41 UTC
Created attachment 118407 [details]
non broken PDF
Comment 16 felipe 2015-09-04 22:36:41 UTC
Does NOT work for me.

(Steve, your latest attachment won’t download to me … something about an incorrect MIME type.)

The same reproduction steps as before yield the same bug, on the same MacOS and LO version that you cited.
Comment 17 steve 2015-09-05 06:51:50 UTC
Felipe, thanks for the feedback. By now I re-read the entire bug and am unsure what this bug is about. From what I read there are two issues here:

1. PDF export mangles the document (we need exact a) b) comparison of what the document looked like in LO and what is broken in the exported PDF. Currently we do not know what we are looking for. Please be as specific as possible.

2. SVG not displayed correctly in LO: Again, I am not sure what we are looking for. I am seeing a note staff with a "W" on it. Is that the expected result or not? If not, again a) b) would be important to have.
Regarding the SVG I did open the file in Chromium, Firefox and Safari: Only Safari did show a staff with notes in it. Firefox, Chromium (and LO) did display a staff with a "W" in it.

To move things into a useful direction I am tempted to suggest to create new bugs - one for each problem (that's the general policy anyhow). Then again, if Firefox and Chromium fail to properly display the SVG, LO has some great company and I'd want some dev input about this specific SVG file.
Comment 18 Alex Thurgood 2015-09-11 11:24:16 UTC
(In reply to steve -_- from comment #17)
> Felipe, thanks for the feedback. By now I re-read the entire bug and am
> unsure what this bug is about. From what I read there are two issues here:
> 

Hi Steve,

See my comment 11

The problem is the incorrect SVG import (and display in Writer), which logically leads to an incorrect PDF on export.

The stave should show music notes and not the "W" symbol.

Open the SVG in Safari and you will see the difference.
Comment 19 Alex Thurgood 2015-09-11 11:27:48 UTC
Setting to NEW as this was never fixed.
Comment 20 Alex Thurgood 2015-09-11 11:31:27 UTC
Note that the PDF isn't as mangled in LO 5012 as Felipe's attachment, only the export of the incorrectly imported SVG is of course wrong.

Correcting title to reflect this.
Comment 21 Alex Thurgood 2015-09-11 11:33:56 UTC
It would probably be better to check whether this isn't a duplicate of other, related SVG import bugs.
Comment 22 steve 2015-09-11 11:39:08 UTC
Alex, agreed. I still wonder though why Firefox and Chromium (both browsers with a lot more users than safari) both incorrectly show the music staff svg without the notes but with the wrong "w".
Comment 23 eisa01 2017-10-28 20:52:42 UTC
The PDF itself exports fine for me now, but the SVG is not rendered correctly

I've created bug 113501 for the SVG rendering, as that's a separate issue

Version: 6.0.0.0.alpha1+
Build ID: 15dce20e8b97dbd0179f01910ca4d0027e80ff4e
CPU threads: 2; OS: Mac OS X 10.12.6; UI render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2017-10-20_06:46:46
Locale: en-US (en_US.UTF-8); Calc: group