Bug report #7671
SVG symbols not correctly exported to svg and pdf via print composer
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Mac OS X||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||16588|
I'm using svg symbols taken from https://github.com/mapbox/maki in my maps.
When I try to export layers from print composer to svg (or pdf) for further editing in Inkscape, the icons are messed up.
Printing to pdf (osx preview) preserves the correct style.
Print composer also displays icons in the right way.
Attached are one of the SVG symbols I used, the svg and pdf export of print composer and the "printed" pdf
#2 Updated by Larry Shaffer over 7 years ago
Please test this with the nightly build of pre-2.0 available here
When running that version, all of your settings and plugins will be 'missing' or reset as it uses a new settings and plugins directory structure. This should not affect your 1.8 setup. Of note, however, is that your version of the Kyngchaos frameworks may be outdated for use by the nightly, so just launch the nightly to find out. The Snow Leopard nightly does not yet use the very latest frameworks, so it should not hurt anything by upgrading your frameworks.
#4 Updated by Andrea Ghensi over 7 years ago
I tried to clean up the icons with http://launchpad.net/svg-cleaner
now the rectangular border doesn't show up (because is not there anymore).
I found that the source svg have 2 objects/paths, but the icon on the exported svg is composed of 4 groups, one of wich is the undesired black border.
You can see it in the attachments using inkscape xml editor.
It happens in both 1.8.0 and 1.9.0 (QGIS_2.0-dev_SnoLeo 1.9.0-Master (6d046fc))
#5 Updated by Andrea Ghensi over 7 years ago
- File Schermata_2013-05-27_a_11.25.50.png added
Now I'm using 1.9.0 93faa76, still the same.
In the attached image there's an exported pdf on the left and the composer window on the right. The pdf exporter adds borders.
If I print to PDF file, the hillshade raster results very grainy (low dpi?)
I also tried to add an inkscape svg into the composer to overlay some arrows and schemes (in order to avoid svg or pdf export), but composer doesn't display line/arrow heads.
I'm a bit in a hurry, so for now I'm going to try TileMill, but I really would like to see this bug resolved soon!
#7 Updated by Jonathan Gutschi over 6 years ago
I'm experiencing the same issue on Ubuntu 14.04 LTS using QGIS 2.0.1.
Confirming that running the Mapbox Maki icons through SVG-Cleaner as suggested by Andrea does fix the problem as a workaround.
Exporting through the system print dialog does however not work on Ubuntu. The icons are still drawn with a rectangle border in the same way as when using the export to PDF or SVG option.
Was any progress made so far in figuring out why the icons are rendered correctly on screen and in the preview but not when exporting?
@Andrea: Thanks for reporting this, certainly saved me a lot of time!
#8 Updated by Daan Goedkoop over 4 years ago
- File analysis.png added
Still a problem in version 2.14.
Apparently, when an svg image is exported, through the print composer, to pdf or svg, not only the border and the filling is rendered, but also another border, using the fill color (or with neither pen nor fill style set if the object has no fill). The width of this second border, and therefore the impact of this bug, seems to be dependent on the coordinates in the source svg. With an svg with coordinates in the range 0-1000 the width of the wrongly added second border is very small; with an svg with coordinates in the range 0.00-1.00 this border gets huge.
The attachment shows a dissection of the export of two svg files. They had the same contents, just different orders of magnitude for the coordinates. For each file the left column shows the border (as intended), the middle column the fill (as intended) and the right column the wrongly created second border.