Saving canvas in PDF

Try this code that you can find here.

Kf

<html><head>
  <meta charset="UTF-8">  
   <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.1/p5.js"></script>
   <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.1/addons/p5.dom.min.js"></script>
   <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.1/addons/p5.sound.min.js"></script>-->   
   <script src="https://cdnjs.cloudflare.com/ajax/libs/svg.js/2.6.5/svg.min.js"></script>
  
  <title>EtherCoil</title>
  <link rel="stylesheet" type="text/css" href="style.css" />
  
</head>
<body>

<!--  hash -->
<div style="text-align:center;">
<h1>EtherCoil</h1>
<p id="hash">EtherCoil</p>
</div>

<br/>

<!-- coil -->
<div style="text-align:center;"  id="myContainer"></div>


<script>  
function setup(){
     var myCanvas = createCanvas(400, 400,SVG);
     myCanvas.parent('#myContainer');
     background(194);
     fill(200,25,25);
     ellipse(width/2,height/2,50,50);
}     
</script>


 </body></html>