Export from P5 to PDF/SVG

Hi,

actually you don’t load the right library. I’ve made a quick search it seems that you download from here : svg.js - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers your lib, which is actually a js lib for manipulating canvas, but not the one to use canvas with p5 !
I didn’t find any CDN for P5.svg.js, and I used to use it locally, I recommend you to download it from here : p5.js-svg/getting-started.md at master · zenozeng/p5.js-svg · GitHub
And then the only thing you need to do is to create a canvas with SVG as third argument, no more.
When you’ll export it, it will be a .svg format.

1 Like