skip to content
Notes && Anecdotes
A decorative, semi-related stock photo that adds less value than this comment.

Don't convert SVG to PNG in the browser


I promise I tried to do it with client-side Javascript only. And I promise I won’t try again before 2020. Google returns so many optimistic answers, that on the bottom has a disclaimer: “This does not work with Safari”, or “This crashes IE9”, or just no disclaimer. But don’t believe them: **It can’t be done. JUST FORGET IT. **It’s like adjusting your HTML newsletter to look good in all versions of Outlook. It’ll just make you kill yourself. Instead, do it server side: With JavaScript and Node you can rely on PhantomJS to convert it consistently, or with Java you can use org.apache.batik.transcoder. GIST: Java server side converting svg to svg/png file using batik.

Next PostES6 notes