Closed nidi3 closed 7 years ago
Ups, seams to be a problem with my SVG, not with salamander.
I hit the same problem and want to share a workaround in hope someone else might profit in the future.
One cause of WARNING: Could not parse path svgSalamander:/transparent
can be an invalid color "transparent". The valid color to render transparant would be "none". One reason for an SVG with a color "transparent" might be, that it was generated by graphviz, see https://gitlab.com/graphviz/graphviz/-/issues/1863
As there is no fix for graphviz in sight, I decided to manipulate the SVG with svgSalamander before rendering. I use the following code to do so.
//replace the stroke color "transparent" with "none" to have a valid SVG
//https://gitlab.com/graphviz/graphviz/-/issues/1863
SVGElement graph = diagram.getRoot().getChild(0);
for (int i = 0; i < graph.getNumChildren(); i++) {
if (graph.getChild(i).hasAttribute("stroke", AT_XML)) {
graph.getChild(i).setAttribute("stroke", AT_XML, "none");
}
}
When creating an SVG from a stream
the output is correctly created, but these warnings are emitted:
How can this be avoided?