Bug 71068 - SVG embedded in text document is exported incorrectly to PDF
Summary: SVG embedded in text document is exported incorrectly to PDF
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
4.0.5.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:4.4.0
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-30 23:50 UTC by Pedro
Modified: 2015-05-28 17:41 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
ODT file with embedded SVG image (26.09 KB, application/vnd.oasis.opendocument.text)
2013-10-30 23:52 UTC, Pedro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro 2013-10-30 23:50:47 UTC
This bug was reported at AskLO. When an SVG is embedded in a document, exporting to PDF produces a distorted image.

See further information in the topic
http://ask.libreoffice.org/en/question/23936/weird-svg-bug-in-libreoffice-4123/
Comment 1 Pedro 2013-10-30 23:52:07 UTC
Created attachment 88384 [details]
ODT file with embedded SVG image
Comment 2 Pedro 2013-10-31 00:05:58 UTC
Exporting the attached document to PDF produces different results (at least under Windows XP Pro x86 SP3) depending on the LO version used...

Using LO 3.5.7 or 3.6.7 it produces a bitmap similar to the vector image
http://ask.libreoffice.org/upfiles/13817927252215989.png
which is coherent with
https://bugs.freedesktop.org/show_bug.cgi?id=42092

Using LO 4.0.5.2 and 4.1.3.2 produces slightly different versions of
http://img42.imageshack.us/img42/9483/i3zx.png

Finally, using version 4.2.0.0 Alpha produces something completely different
http://ask.libreoffice.org/upfiles/13817920403110956.png
Comment 3 Julien Nabet 2013-11-03 09:27:55 UTC
On pc Debian x86-64 with master sources updated yesterday, I reproduced the problem.

Here are some logs:
warn:legacy.osl:7768:1:svgio/source/svgreader/svgtools.cxx:40: Unknown Base SvgToken <metadata> (!)
warn:legacy.osl:7768:1:svgio/source/svgreader/svgtools.cxx:40: Unknown Base SvgToken <rdf:RDF> (!)
warn:legacy.osl:7768:1:svgio/source/svgreader/svgtools.cxx:40: Unknown Base SvgToken <cc:Work> (!)
warn:legacy.osl:7768:1:svgio/source/svgreader/svgtools.cxx:40: Unknown Base SvgToken <dc:format> (!)
warn:legacy.osl:7768:1:svgio/source/svgreader/svgtools.cxx:40: Unknown Base SvgToken <dc:type> (!)
warn:legacy.osl:7768:1:svgio/source/svgreader/svgtools.cxx:40: Unknown Base SvgToken <sodipodi:namedview> (!)
warn:sfx.control:7768:1:sfx2/source/control/dispatch.cxx:1469: Childwindow slot missing: 10365
warn:sfx.control:7768:1:sfx2/source/control/dispatch.cxx:1469: Childwindow slot missing: 10365
warn:sfx.control:7768:1:sfx2/source/control/dispatch.cxx:1469: Childwindow slot missing: 10365
warn:sfx.dialog:7768:1:sfx2/source/dialog/tabdlg.cxx:1039: CreateInputItemSet not implemented
warn:sfx.dialog:7768:1:sfx2/source/dialog/tabdlg.cxx:1039: CreateInputItemSet not implemented
warn:sfx.dialog:7768:1:sfx2/source/dialog/tabdlg.cxx:1039: CreateInputItemSet not implemented
warn:sfx.dialog:7768:1:sfx2/source/dialog/tabdlg.cxx:1039: CreateInputItemSet not implemented
warn:sfx.dialog:7768:1:sfx2/source/dialog/tabdlg.cxx:1039: CreateInputItemSet not implemented

Michael: do you know who may help here?
Comment 4 Michael Meeks 2013-11-04 09:50:04 UTC
Christina or Thorsten may have an idea :-)
Comment 5 Alexandr 2014-07-31 18:35:46 UTC
Reproducible with LibreOffice 4.2.5 and 4.3.0 on Debian.
Comment 6 Pedro 2014-07-31 21:58:49 UTC
Additional information: The thumbnail shows the same wrong image that is exported to PDF and not what is shown when the file is open.
Comment 7 Regina Henschel 2014-08-01 12:41:05 UTC
The error is not in the pdf export, but already in converting to metafile.
Comment 8 Luke 2014-08-25 20:16:30 UTC
Armin Le Grand fixed this bug in AOO with
http://svn.apache.org/viewvc?view=revision&revision=1616154
for this related bug:
https://issues.apache.org/ooo/show_bug.cgi?id=125349

Can someone work on porting this patch into LO?
Comment 9 Regina Henschel 2014-08-25 20:42:00 UTC
It has already been integrated 2014-08-07. Please test in a current daily build.
Comment 10 Alexandr 2014-08-26 18:25:33 UTC
I test the document with LibreOffice 4.4.0.0.alpha0+
Build ID: 37b9ea92ba81d74764a2345a9c75c65bfd272d2b
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-08-26_09:48:30

The result of pdf export is much better. As far as I understand Luke's and Regina's comments, it was done with commits:
http://cgit.freedesktop.org/libreoffice/core/commit/basegfx/source/polygon/b2dpolygonclipper.cxx?id=1ca06ce59b7d3cea873d2dc109a2acaec0a80759
http://cgit.freedesktop.org/libreoffice/core/commit/basegfx/source/polygon/b2dpolygonclipper.cxx?id=5554be7f4cddcfeb450bfe41d0b588c8e8f6de76

Unfortunately, the export is not perfect. I see parallel lines in red and green areas. Should we mark this one as fixed and open another report? Should we ask somebody to port the patches to 4.3 branch?
Comment 12 Michael Meeks 2014-08-26 19:29:09 UTC
Always good to file a new bug and link back to this one I guess; wrt. back-porting 4.3 hasn't diverged much from master yet - it should be an easy job for a beginner - could make it its own stand-alone easy hack if you want to file one ? =)
Comment 13 Alexandr 2015-05-24 10:38:19 UTC
The 4.3 branch is at the end of life. In 4.4 and 5.0 branches the bug is fixed.

The lines that I mentioned in comment 10 are different in different viewers and with different scales. I am not sure that it is a LibreOffice bug.
Comment 14 Pedro 2015-05-24 18:32:21 UTC
(In reply to Alexandr from comment #13)
> The 4.3 branch is at the end of life. In 4.4 and 5.0 branches the bug is
> fixed.
> The lines that I mentioned in comment 10 are different in different viewers
> and with different scales. I am not sure that it is a LibreOffice bug.

It is arguable that if the pdf output does not look exactly like the document, it should be considered fixed... However it is indeed a great improvement over when I reported the bug.

Curiously downloading again the svg from wikipedia and inserting in a new odt using LO 5.0 Beta and exporting to pdf does create a much better output, without the lines but with jaggies on the outer edge.
Comment 15 Luke 2015-05-25 00:31:42 UTC
Pedro and Alexandr,
The PDF is still not exported correctly. If you're going close this bug as FIXED, please open a new report about the parallel lines and link it to this one.
Comment 16 Alexandr 2015-05-28 17:41:18 UTC
I have reported the issue with parallel lines as bug 91703.