问题
I have several thousand d3 charts and my client wants to print them for a report. The client needs them in EPS. I have bought Illustrator to convert them but when I open the SVG file the formatting has disappeared. This holds even when I put the CSS into the html page itself and not externally. Is there any way I can turn CSS + SVG into an EPS?
回答1:
I just tried this approach in my illustrator and it does honor the CSS declarations inside the <svg />
element.
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width=".." height=".." viewBox="..">
<style type="text/css">
<![CDATA[
polygon{
fill:none;
}
#myPath{
/*styles here*/
}
]]>
</style>
<!-- SVG content -->
</svg>
I was then able to save my SVG as an EPS with the CSS styles applied.
来源:https://stackoverflow.com/questions/34926050/can-i-turn-svg-and-external-css-into-eps