Skip to main content

I am trying to export and save an SVG file.


I have tried exportAsync in following code which is returning svg code, but how i can save it as svg file.


let node = figma.currentPage.selection[0];
node.exportAsync({format: 'SVG'}).then(res => console.log(String.fromCharCode.apply(null, res))).catch(err => console.error(err));

figma.closePlugin();

Please help 🙂

Hey man, this might help you:


GitHub

To export SVGs or PDFs, You can simply post message to UI’s window and save a respective SVG or PDF file using Blob. Hope this helps 🙌



Hi,

I’m actually trying to do the same thing but I just need image and getting this error


Argument of type 'Uint8Array' is not assignable to parameter of type 'numbere]'.
Type 'Uint8Array' is missing the following properties from type 'numbere]': pop, push, concat, shift, and 5 more.ts(2345)

Reply