1

I want to download as a PNG image using amazon s3 url which is a svg. What's the ideal way to convert this SVG to PNG and download it?

s3 URL: https://eocs-icons.s3.amazonaws.com/withText/2022/clean.svg

Apostolos
  • 10,033
  • 5
  • 24
  • 39
codingrohtak
  • 160
  • 8
  • so you want to save it as png? – Apostolos Oct 20 '22 at 05:44
  • @Apostolos yes. Any useful link for reference would be really helpful. – codingrohtak Oct 20 '22 at 05:47
  • you can't just download an SVG *as a PNG* and expect some majicks to convert it for you - The ideal way is to convert it – Jaromanda X Oct 20 '22 at 05:48
  • 1
    a "google" search for "convert SVG to PNG in javascript" yielded [this](https://stackoverflow.com/a/74026755/5053002) on stack overflow - I've linked to the answer posted 7 DAYS ago on this 10+ year old question - so, don't be put off by the age of the question – Jaromanda X Oct 20 '22 at 05:49
  • to be honest, if you hadnt commented the 7 days vs 10+ years i may have not opened the link but i was curious enough! great answer by this guy! – Apostolos Oct 20 '22 at 05:51
  • @JaromandaX I failed to understand the correct usage of s3 url. Where do I have to use it in the code? – codingrohtak Oct 20 '22 at 06:06
  • Why can't you use the svg? Is your question maybe "how can I render an svg in React"? – JBallin Oct 20 '22 at 06:06
  • oh, you'd have to download the SVG using the "SVG url" and fetch or XMLHttpRequest of course – Jaromanda X Oct 20 '22 at 06:07

0 Answers0