Comment 0 for bug 1258265

Revision history for this message
Joachim Hein (joac-hein) wrote :

svg graphics exported by some software (Mathematica 8.0 in my case) may contain groups that have a property of clip-path="url(.....)" and a corresponding <clipPath with the referenced id. In such cases the contained polygons filled with an alpha channel color will turn into non-transparent color if exported to the pdf-format.
This is new to inkscape version 0.48.4 (pdf reports cairo 1.12.16). Earlier versions converted the same svg graphics correctly (pdf reports cairo 1.12.2, incscape version not known anymore).
If the clip-path=... property is simply deleted from the svg, pdf-export is correct again (but a clipping frame may be lost at the same time). The same could be achieved by importing the svg into inkscape, then degrouping all grouped objects and group them again. Inkscape then will place the <clipPath outside the groups and is now able to do the export correctly. This may also an svg inconsistency.
My workaround in background svg-to-pdf conversion is to use a sed editor command to delete the relevant lines from the svg before the conversion to pdf:

sed 's/clip\-path="url(#cp[0-9]*)"//g' orig.svg > new.svg

in order to simulate the behavior of the old inkscape as long as <clipPath is irrelevant, what is mostly the case for Mathematica graphics output. Ideas for alternative approaches are welcome!