Search code examples
csssvggraphicsadobe-illustratoreps

Can I turn SVG and external CSS into EPS?


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?


Solution

  • 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.