3 Replies Latest reply on Aug 8, 2017 9:49 AM by andreyo28152172

    Export SVG for WEB script

    andreyo28152172 Level 1

      Hello, I am writing an automation script for Illustrator CC 2017. The goal of the script is to take an .ai file and export it as an SVG file for the web...
      These are the EXACT settings I need the SVG to be exported with...



      My Exported SVG file needs to be encoded as follows :

      <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1440 1440">
            .cls-1, .cls-519, .cls-52, .cls-8 {
              fill: none;
            .cls-2 {
              isolation: isolate;
            .cls-3 {
              fill: #96c0e1;
            .cls-3, .cls-4, .cls-5 {
              mix-blend-mode: overlay;
            .cls-4 {
              fill: #73a353;
            .cls-5 {
              fill: #9fb3b6;
            .cls-520, .cls-6 {
              fill: #a1a1a1;



      However the output File looks like this :

      <?xml version="1.0" encoding="iso-8859-1"?>
      <!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
      <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
        viewBox="0 0 1440 1440" style="enable-background:new 0 0 1440 1440;" xml:space="preserve">
      <filter  id="AI_GaussianBlur_4">
        <feGaussianBlur  stdDeviation="4"></feGaussianBlur>
      <g id="CLASS2">
        <path style="fill:#96C0E1;" d="M1258.797,1037.885c6.219-0.21,12.669-3.228,11.681-10.547c-1.569-11.581-21.712-4.747-27.9-2.616


      My function looks like this :

      function exportSVG(){
          var doc = activeDocument;
          var file = new File("/Users/uv/Desktop/dd-fileintake-engine/scripts/test.svg")
          var options = new ExportOptionsSVG();
          var type = ExportType.SVG;
          options.embedRasterImages = true;
          options.fontType = SVGFontType.SVGFONT;
          options.DTD = SVGDTDVersion.SVG1_1;
          options.cssProperties = SVGCSSPropertyLocation.STYLEELEMENTS;
          doc.exportFile(file, type, options);

      If some one could please explain to me what I am doing wrong with the options object I would greatly appreciate it !!!
      Thank you all for your time !