# Saving canvas in PDF

**URL:** <https://discourse.processing.org/t/saving-canvas-in-pdf/3025>\
**Category:** Libraries\
**Created:** [August 27, 2018, 4:12pm UTC](https://discourse.processing.org/t/saving-canvas-in-pdf/3025 "2018-08-27T16:12:06Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [August 28, 2018, 1:31am UTC](https://discourse.processing.org/t/saving-canvas-in-pdf/3025/9 "2018-08-28T01:31:50Z")

</div>

Try this code that you can find [here](http://p5js.sketchpad.cc/sp/pad/view/w105lv1K2q/latest).

Kf

```auto
<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>

```

---

_[View the full topic](https://discourse.processing.org/t/saving-canvas-in-pdf/3025)._
