I'm currently working on a site, and can't export SVG's from Sketch itself with no issue, but I am missing the Base64 code. Can I generate Base64 encoded SVG's from Sketch 3 when I export?
-
"can't export [...] with no issue, but [...]" is there a typo or improper negation in there?– YorikFeb 23, 2016 at 19:56
-
Hi Gran, Do you mind me asking why you want base64 SVG? encoding SVG to base64 generally increases the file size, and since SVG is XML based you can usually just embed the code as-is with no problem. Unless you have some specific use case– CaiFeb 23, 2016 at 20:01
-
I think base64 is the preferred way of embedding binary data inside an xml file (possibly also "cdata", but that can get mangled). Perhaps the OP is really asking about gzip (SVGZ)?– YorikFeb 23, 2016 at 20:14
-
Ok good point, I didn't think of that. If SVGZ is an option I think that would be the way to go.– CaiFeb 23, 2016 at 20:40
-
Are you talking about including a base64-encoded bitmap image within your exported SVG?– Simon WhiteFeb 24, 2016 at 8:54
1 Answer
No, unfortunately you can't export base64 encoded files directly from Sketch. I checked Sketch Toolbox and it doesn't look like there's a plugin for that either, not yet anyway ;)
Generating base64 data URIs is still a surprisingly manual process — personally, I typically use this base63 encoder and paste in/upload my data.