Code for serving svg files in GAS...

69 views
Skip to first unread message

burtran...@gmail.com

unread,
Jan 29, 2021, 3:55:46 PM1/29/21
to Google Apps Script Community
It doesn't work, but I'm trying to learn:

JS
function doGet() {
    return createHtmlOutputFromFile('KI_SVG_Test');
       getContent()  
}

HTML
<!DOCTYPE html>
<html>
  <head>
    <!--1-->
    <!--2-->
    <!--3-->
    <svg class="icon icon-E000-uldf-f"><use xlink:href="#icon-E000-uldf-f"></use></svg>
   
  </head>
  <body>
    <symbol id="icon-E000-uldf-f" viewBox="0 0 32 32">
      <path d="M-25.942-16.073c0 0 0 0 0 0zM8.65 20.977c0 0 0 10.737 0 10.737s2.685 0 2.685 0c0 0 0-10.737 0-10.737s-2.685 0-2.685 0zM8.65 29.030c0 0 0 2.685 0 2.685s16.105 0 16.105 0c0 0 0-2.685 0-2.685s-16.105 0-16.105 0zM22.072 20.977c0 0 0 10.737 0 10.737s2.685 0 2.685 0c0 0 0-10.737 0-10.737s-2.685 0-2.685 0z"></path>
    </symbol>    
  </body>
</html>

CSS
<style>

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  stroke-width: 0;
  stroke: currentColor;
  fill: currentColor;
}

<style>

Alan Wells

unread,
Jan 29, 2021, 4:03:06 PM1/29/21
to Google Apps Script Community
getContent should be commented out.

function doGet() {
    return createHtmlOutputFromFile('KI_SVG_Test');
       //getContent()  

burtran...@gmail.com

unread,
Jan 29, 2021, 4:19:08 PM1/29/21
to Google Apps Script Community
I know, but it works so much better when it's there...

burtran...@gmail.com

unread,
Jan 29, 2021, 4:19:45 PM1/29/21
to Google Apps Script Community
not there
Reply all
Reply to author
Forward
0 new messages